summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2010-10-03 23:06:40 +0200
committerGraeme Geldenhuys <graemeg@gmail.com>2010-10-03 23:06:40 +0200
commit0aeb51dbc892cf76f3065c1df81f310103c97f8d (patch)
tree6a2f4beccf54e33a0b9ebe553169f7ff3f02fe6a /src
parent636c0d92e030ca7168d5b9785a9702d0927a3df6 (diff)
downloadfpGUI-0aeb51dbc892cf76f3065c1df81f310103c97f8d.tar.xz
X11: fake a Resize event after the window is mapped (shown).
X11 seems too efficient, so one the initial mapping of the window to the display, no resize event needs to occur, and it doesn't. This screws with Align property which expects as Resize event (like Windows GDI). So we fake a resize event.
Diffstat (limited to 'src')
-rw-r--r--src/corelib/x11/fpg_x11.pas9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/corelib/x11/fpg_x11.pas b/src/corelib/x11/fpg_x11.pas
index 24fa599c..a5fb68e0 100644
--- a/src/corelib/x11/fpg_x11.pas
+++ b/src/corelib/x11/fpg_x11.pas
@@ -1902,6 +1902,15 @@ begin
w := FindWindowByHandle(ev.xmap.window);
if w <> nil then
Include(w.FWinFlags, xwsfMapped);
+
+ { X11 is too efficient, so new windows don't need a OnResize when mapped,
+ but because Windows GDI does so, we want the same events under X11.
+ Lets fake one. }
+ msgp.rect.Left := w.Left;
+ msgp.rect.Top := w.Top;
+ msgp.rect.Width := w.Width;
+ msgp.rect.Height := w.Height;
+ fpgPostMessage(nil, w, FPGM_RESIZE, msgp);
end;
X.UnmapNotify: