mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-28 19:02:05 +02:00
+ support for SysResize event for Amiga
git-svn-id: trunk@11998 -
This commit is contained in:
parent
4a5a3e3118
commit
2e72bd03a7
@ -31,8 +31,6 @@ var
|
||||
lastxsize,lastysize : longint;
|
||||
|
||||
procedure InitSystemMsg;
|
||||
//var
|
||||
// WinSize : TWinSize;
|
||||
begin
|
||||
If SystemEventActive then
|
||||
exit;
|
||||
@ -41,13 +39,11 @@ begin
|
||||
PendingSystemTail:=@PendingSystemEvent;
|
||||
PendingSystemEvents:=0;
|
||||
FillChar(LastSystemEvent,sizeof(TSystemEvent),0);
|
||||
// FillChar(WinSize,sizeof(WinSize),0);
|
||||
// fpioctl(stdinputhandle,TIOCGWINSZ,@winsize);
|
||||
// LastXSize:=WinSize.ws_row;
|
||||
// LastYSize:=WinSize.ws_col;
|
||||
// If LastXSize=0 then
|
||||
Video.HasResizeWindow(LastXSize,LastYSize);
|
||||
|
||||
If LastXSize=0 then
|
||||
LastXSize:=80;
|
||||
// If LastYSize=0 then
|
||||
If LastYSize=0 then
|
||||
LastYSize:=25;
|
||||
|
||||
SystemEventActive:=true;
|
||||
@ -78,6 +74,7 @@ end;
|
||||
|
||||
|
||||
function PollSystemEvent(var SystemEvent: TSystemEvent):boolean;
|
||||
var width, height : longint;
|
||||
begin
|
||||
SystemEvent.typ:=SysNothing;
|
||||
if not SystemEventActive then
|
||||
@ -95,21 +92,17 @@ begin
|
||||
SystemEvent.CloseTyp:=0;
|
||||
PutSystemEvent(SystemEvent);
|
||||
PollSystemEvent:=true;
|
||||
end;
|
||||
{
|
||||
FillChar(WinSize,sizeof(WinSize),0);
|
||||
fpioctl(stdinputhandle,TIOCGWINSZ,@winsize);
|
||||
if (winsize.ws_col<>0) and (winsize.ws_row<>0) and
|
||||
((winsize.ws_row<>lastxsize) or (winsize.ws_col<>lastysize)) then
|
||||
begin
|
||||
end else if Video.HasResizeWindow(width, height) then begin
|
||||
if (width>0) and (height>0) and
|
||||
((width<>lastxsize) or (height<>lastysize)) then begin
|
||||
SystemEvent.typ:=SysResize;
|
||||
SystemEvent.x:=WinSize.ws_col;
|
||||
SystemEvent.y:=WinSize.ws_row;
|
||||
SystemEvent.x:=width;
|
||||
SystemEvent.y:=height;
|
||||
PutSystemEvent(SystemEvent);
|
||||
LastXSize:=WinSize.ws_row;
|
||||
LastYSize:=WinSize.ws_col;
|
||||
LastXSize:=width;
|
||||
LastYSize:=height;
|
||||
PollSystemEvent:=true;
|
||||
end}
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user