summaryrefslogtreecommitdiff
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/fpg_base.pas10
-rw-r--r--src/corelib/x11/fpg_netlayer_x11.pas2
-rw-r--r--src/corelib/x11/fpg_x11.pas12
3 files changed, 16 insertions, 8 deletions
diff --git a/src/corelib/fpg_base.pas b/src/corelib/fpg_base.pas
index 37e19471..979ac61a 100644
--- a/src/corelib/fpg_base.pas
+++ b/src/corelib/fpg_base.pas
@@ -45,7 +45,7 @@ type
TWindowType = (wtChild, wtWindow, wtModalForm, wtPopup);
- TWindowAttribute = (waSizeable, waAutoPos, waScreenCenterPos, waStayOnTop, waFullScreen, waBorderless);
+ TWindowAttribute = (waSizeable, waAutoPos, waScreenCenterPos, waStayOnTop, waFullScreen, waBorderless, waUnblockableMessages, waX11SkipWMHints);
TWindowAttributes = set of TWindowAttribute;
TMouseCursor = (mcDefault, mcArrow, mcCross, mcIBeam, mcSizeEW, mcSizeNS,
@@ -453,6 +453,8 @@ type
end;
+ { TfpgApplicationBase }
+
TfpgApplicationBase = class(TComponent)
private
FMainForm: TfpgWindowBase;
@@ -473,6 +475,7 @@ type
procedure PushModalForm(AForm: TfpgWindowBase);
procedure PopModalForm;
function PrevModalForm: TfpgWindowBase;
+ function RemoveWindowFromModalStack(AForm: TfpgWindowBase): Integer;
procedure CreateForm(AFormClass: TComponentClass; out AForm: TfpgWindowBase);
function GetScreenWidth: TfpgCoord; virtual; abstract;
function GetScreenHeight: TfpgCoord; virtual; abstract;
@@ -2112,6 +2115,11 @@ begin
Result := TfpgWindowBase(FModalFormStack.Items[FModalFormStack.Count-2]);
end;
+function TfpgApplicationBase.RemoveWindowFromModalStack (AForm: TfpgWindowBase): Integer;
+begin
+ Result := FModalFormStack.Remove(AForm);
+end;
+
procedure TfpgApplicationBase.CreateForm(AFormClass: TComponentClass;
out AForm: TfpgWindowBase);
begin
diff --git a/src/corelib/x11/fpg_netlayer_x11.pas b/src/corelib/x11/fpg_netlayer_x11.pas
index b6d0dd70..6a2aeeb6 100644
--- a/src/corelib/x11/fpg_netlayer_x11.pas
+++ b/src/corelib/x11/fpg_netlayer_x11.pas
@@ -317,7 +317,7 @@ var
I: Integer;
ANetAtom: TNetAtomEnum;
begin
- if WindowGetPropertyAtom(FRootWindow, FNetAtoms[naSUPPORTED], AtomCount, Atoms) = False then;// Exit;
+ if WindowGetPropertyAtom(FRootWindow, FNetAtoms[naSUPPORTED], AtomCount, Atoms) = False then Exit;
//WriteLn('RootWindow Atom Count = ',AtomCount);
FillChar(FAtomSupported, SizeOf(Boolean) * Length(FAtomSupported), 0);;
for I := 0 to AtomCount-1 do begin
diff --git a/src/corelib/x11/fpg_x11.pas b/src/corelib/x11/fpg_x11.pas
index 385b1361..6aad85d0 100644
--- a/src/corelib/x11/fpg_x11.pas
+++ b/src/corelib/x11/fpg_x11.pas
@@ -714,7 +714,7 @@ begin
inherited Create(AParams);
FIsInitialized := False;
FDisplay := XOpenDisplay(PChar(aparams));
-
+
if FDisplay = nil then
raise Exception.Create('fpGUI-X11: Could not open the display. Is your X11 server running?');
@@ -1050,7 +1050,7 @@ begin
if xapplication.TopModalForm <> nil then
begin
ew := TfpgWindowImpl(WidgetParentForm(TfpgWidget(w)));
- if (ew <> nil) and (xapplication.TopModalForm <> ew) then
+ if (ew <> nil) and (xapplication.TopModalForm <> ew) and (waUnblockableMessages in ew.WindowAttributes = False) then
blockmsg := true;
end;
@@ -1128,7 +1128,7 @@ begin
if xapplication.TopModalForm <> nil then
begin
ew := TfpgWindowImpl(WidgetParentForm(TfpgWidget(w)));
- if (ew <> nil) and (xapplication.TopModalForm <> ew) then
+ if (ew <> nil) and (xapplication.TopModalForm <> ew) and (waUnblockableMessages in ew.WindowAttributes = False) then
blockmsg := true;
end;
if not blockmsg then
@@ -1163,7 +1163,7 @@ begin
begin
// This is ugly!!!!!!!!!!!!!!!
ew := TfpgWindowImpl(WidgetParentForm(TfpgWidget(w)));
- if (ew <> nil) and (xapplication.TopModalForm <> ew) then
+ if (ew <> nil) and (xapplication.TopModalForm <> ew) and (waUnblockableMessages in ew.WindowAttributes = False) then
blockmsg := true;
end;
@@ -1372,7 +1372,7 @@ begin
FillChar(attr, sizeof(attr), 0);
mask := 0;
- if FWindowType in [wtPopup] then
+ if (FWindowType in [wtPopup]) or (waX11SkipWMHints in FWindowAttributes) then
begin
attr.Override_Redirect := TBool(True);
mask := CWOverrideRedirect;
@@ -1465,7 +1465,7 @@ begin
fpgApplication.netlayer.WindowSetType(FWinHandle, [nwtSplash]);
// process Borderless forms
- if ((FWindowType = wtWindow) or (FWindowType = wtModalForm)) and (waBorderless in FWindowAttributes) then
+ if ((FWindowType = wtWindow) or (FWindowType = wtModalForm)) and (waBorderless in FWindowAttributes) and not (waX11SkipWMHints in FWindowAttributes) then
begin
prop := X.None;
prop := XInternAtom(xapplication.display, '_MOTIF_WM_INFO', longbool(0));