mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-10 15:05:58 +02:00
* Fix window resizing in X.
git-svn-id: trunk@3767 -
This commit is contained in:
parent
eab1f74b54
commit
aa93e6a11e
@ -892,6 +892,8 @@ begin
|
||||
{ InitMemory;}
|
||||
InitScreen;
|
||||
Video.SetVideoMode(Mode);
|
||||
ScreenWidth:=Video.ScreenWidth;
|
||||
ScreenHeight:=Video.ScreenHeight;
|
||||
Buffer := Views.PVideoBuf(VideoBuf);
|
||||
R.Assign(0, 0, ScreenWidth, ScreenHeight);
|
||||
ChangeBounds(R);
|
||||
|
@ -112,8 +112,8 @@ begin
|
||||
((winsize.ws_row<>lastxsize) or (winsize.ws_col<>lastysize)) then
|
||||
begin
|
||||
SystemEvent.typ:=SysResize;
|
||||
SystemEvent.x:=WinSize.ws_row;
|
||||
SystemEvent.y:=WinSize.ws_col;
|
||||
SystemEvent.x:=WinSize.ws_col;
|
||||
SystemEvent.y:=WinSize.ws_row;
|
||||
PutSystemEvent(SystemEvent);
|
||||
LastXSize:=WinSize.ws_row;
|
||||
LastYSize:=WinSize.ws_col;
|
||||
|
@ -1307,6 +1307,7 @@ end;
|
||||
procedure SysDoneKeyboard;
|
||||
begin
|
||||
{$ifdef linux}
|
||||
if is_console then
|
||||
unpatchkeyboard;
|
||||
{$endif linux}
|
||||
|
||||
|
@ -1224,13 +1224,33 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function SysSetVideoMode(const mode:Tvideomode):boolean;
|
||||
|
||||
var winsize:Twinsize;
|
||||
|
||||
begin
|
||||
{Due to xterm resize this procedure might get called with the new xterm
|
||||
size. Approve the video mode change if the new size equals that of
|
||||
the terminal window size.}
|
||||
SysSetVideoMode:=false;
|
||||
fpioctl(stdinputhandle,TIOCGWINSZ,@winsize);
|
||||
if (mode.row=winsize.ws_row) and
|
||||
(mode.col=winsize.ws_col) then
|
||||
begin
|
||||
screenwidth:=mode.col;
|
||||
screenheight:=mode.row;
|
||||
screencolor:=true;
|
||||
SysSetVideoMode:=true;
|
||||
end;
|
||||
end;
|
||||
|
||||
Const
|
||||
SysVideoDriver : TVideoDriver = (
|
||||
InitDriver : @SysInitVideo;
|
||||
DoneDriver : @SysDoneVideo;
|
||||
UpdateScreen : @SysUpdateScreen;
|
||||
ClearScreen : @SysClearScreen;
|
||||
SetVideoMode : Nil;
|
||||
SetVideoMode : @SysSetVideoMode;
|
||||
GetVideoModeCount : Nil;
|
||||
GetVideoModeData : Nil;
|
||||
SetCursorPos : @SysSetCursorPos;
|
||||
|
Loading…
Reference in New Issue
Block a user