summaryrefslogtreecommitdiff
path: root/src/corelib/x11
diff options
context:
space:
mode:
authorAndrew Haines <andrewd207@aol.com>2015-02-01 09:37:07 -0500
committerAndrew Haines <andrewd207@aol.com>2015-02-01 09:37:07 -0500
commitdef6be738e34d5ff5d4679a96d25c137aac31e31 (patch)
treeae93f9c8ab2eeb0fcb4722669237b9955e03bae6 /src/corelib/x11
parentfd68cfe060b6c51ef515e61931474e1a088e1ca9 (diff)
downloadfpGUI-def6be738e34d5ff5d4679a96d25c137aac31e31.tar.xz
Changes to allow modal windows to have owners.
Diffstat (limited to 'src/corelib/x11')
-rw-r--r--src/corelib/x11/fpg_x11.pas10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/corelib/x11/fpg_x11.pas b/src/corelib/x11/fpg_x11.pas
index bc9c9dbd..bae72c40 100644
--- a/src/corelib/x11/fpg_x11.pas
+++ b/src/corelib/x11/fpg_x11.pas
@@ -2271,11 +2271,13 @@ var
WMHints: PXWMHints;
prop: TAtom;
mwmhints: TMWMHints;
+ IsToplevel: Boolean;
begin
if HandleIsValid then
Exit; //==>
- if AParent <> nil then
+ IsToplevel := (AParent = nil) or (FWindowType in [wtModalForm, wtPopup]);
+ if not IsToplevel then
pwh := TfpgX11Window(AParent).WinHandle
else
pwh := xapplication.RootWindow;
@@ -2314,7 +2316,7 @@ begin
FWinHandle := wh;
FBackupWinHandle := wh;
- if AParent = nil then // is a toplevel window
+ if IsToplevel then // is a toplevel window
begin
{ setup a window icon }
IconPixMap := XCreateBitmapFromData(fpgApplication.Display, FWinHandle,
@@ -2400,11 +2402,13 @@ begin
// for modal windows, this is necessary
if FWindowType = wtModalForm then
begin
- if Parent = nil then
+ if IsToplevel then
begin
lmwh := 0;
if fpgApplication.PrevModalForm <> nil then
lmwh := TfpgX11Window(fpgApplication.PrevModalForm).WinHandle
+ {else if AParent <> nil then
+ lmwh := TfpgX11Window(AParent).WinHandle}
{ 2011-03-24: Graeme Geldenhuys
I commented code this code because it caused more problems that it solved
when multiple modal dialogs or prompts are shown in succession.