* Fix window resizing in X.

git-svn-id: trunk@3767 -
This commit is contained in:
daniel 2006-06-02 20:46:46 +00:00
parent eab1f74b54
commit aa93e6a11e
4 changed files with 26 additions and 3 deletions

View File

@ -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);

View File

@ -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;

View File

@ -1307,6 +1307,7 @@ end;
procedure SysDoneKeyboard;
begin
{$ifdef linux}
if is_console then
unpatchkeyboard;
{$endif linux}

View File

@ -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;