diff options
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/fpgfx.pas | 2 | ||||
-rw-r--r-- | src/corelib/gdi/gfx_gdi.pas | 1 | ||||
-rw-r--r-- | src/corelib/gfxbase.pas | 2 | ||||
-rw-r--r-- | src/corelib/x11/gfx_x11.pas | 12 |
4 files changed, 12 insertions, 5 deletions
diff --git a/src/corelib/fpgfx.pas b/src/corelib/fpgfx.pas index a769b871..7ba8ed6e 100644 --- a/src/corelib/fpgfx.pas +++ b/src/corelib/fpgfx.pas @@ -707,7 +707,7 @@ procedure TfpgApplication.RunMessageLoop; begin repeat WaitWindowMessage(1000); - until False; + until Terminated; end; { TfpgFont } diff --git a/src/corelib/gdi/gfx_gdi.pas b/src/corelib/gdi/gfx_gdi.pas index 17a3fe3e..97b72460 100644 --- a/src/corelib/gdi/gfx_gdi.pas +++ b/src/corelib/gdi/gfx_gdi.pas @@ -708,6 +708,7 @@ constructor TfpgApplicationImpl.Create(const aparams: string); begin FIsInitialized := False; FDisplay := Windows.GetDC(0); + Terminated := False; with WindowClass do begin diff --git a/src/corelib/gfxbase.pas b/src/corelib/gfxbase.pas index d00f493f..0cac008d 100644 --- a/src/corelib/gfxbase.pas +++ b/src/corelib/gfxbase.pas @@ -369,6 +369,7 @@ type TfpgApplicationBase = class(TObject) private FMainForm: TfpgWindowBase; + FTerminated: boolean; FTopModalForm: TfpgWindowBase; protected FIsInitialized: Boolean; @@ -379,6 +380,7 @@ type property IsInitialized: boolean read FIsInitialized; property TopModalForm: TfpgWindowBase read FTopModalForm write FTopModalForm; property MainForm: TfpgWindowBase read FMainForm write FMainForm; + property Terminated: boolean read FTerminated write FTerminated; end; diff --git a/src/corelib/x11/gfx_x11.pas b/src/corelib/x11/gfx_x11.pas index d27a834c..23df9cbb 100644 --- a/src/corelib/x11/gfx_x11.pas +++ b/src/corelib/x11/gfx_x11.pas @@ -526,6 +526,7 @@ begin if FDisplay = nil then Exit; //==> + Terminated := False; DefaultScreen := XDefaultScreen(Display); RootWindow := XRootWindow(FDisplay, DefaultScreen); DefaultBackground := XBlackPixel(FDisplay, DefaultScreen); @@ -1101,13 +1102,16 @@ end; procedure TfpgWindowImpl.DoSetWindowVisible(const AValue: Boolean); begin - if AValue then begin - if not HandleIsValid then AllocateWindowHandle; + if AValue then + begin + if not HandleIsValid then + AllocateWindowHandle; XMapWindow(xapplication.Display, FWinHandle); Include(FWinFlags, xwsfMapped); end - else begin - if HandleIsValid and (xwsfMapped in FWinFlags) then + else + begin + if HandleIsValid and (xwsfMapped in FWinFlags) then XUnmapWindow(xapplication.Display, FWinHandle); end; end; |