summaryrefslogtreecommitdiff
path: root/src/corelib/x11
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2011-01-10 23:44:33 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2011-01-11 09:45:29 +0200
commit9a622052b07b1605fe4cf4465404df11f0fd12da (patch)
tree91c246ed6dcebeab0ed90d3576af08f97042409e /src/corelib/x11
parent912541f487ef8356352a452c005097623df0cf00 (diff)
downloadfpGUI-9a622052b07b1605fe4cf4465404df11f0fd12da.tar.xz
fixes Alignment and Anchor calculation even before we have a window handle
Updated the following methods by rather checking the ComponentState, than the HasHandle result. Why? Because we want alignment and anchor calculations to work, even before we have a window handle. Something that happens often when using a Frame-type design for the UI. * HandleMove() * HandleResize() * UpdateWindowPosition() Due to removing the HasHandle check in UpdateWindowPosition, we had to do the HasHandle check in each backend code instead. We don't want to trigger API calls when we don't have a window handle yet.
Diffstat (limited to 'src/corelib/x11')
-rw-r--r--src/corelib/x11/fpg_x11.pas20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/corelib/x11/fpg_x11.pas b/src/corelib/x11/fpg_x11.pas
index 8ae27ec1..ab41dc6b 100644
--- a/src/corelib/x11/fpg_x11.pas
+++ b/src/corelib/x11/fpg_x11.pas
@@ -2348,17 +2348,19 @@ var
w: longword;
h: longword;
begin
- if FWidth > 1 then
- w := FWidth
- else
- w := 1;
- if FHeight > 1 then
- h := FHeight
- else
- h := 1;
+ if HasHandle then
+ begin
+ if FWidth > 1 then
+ w := FWidth
+ else
+ w := 1;
+ if FHeight > 1 then
+ h := FHeight
+ else
+ h := 1;
- if FWinHandle > 0 then
XMoveResizeWindow(xapplication.display, FWinHandle, FLeft, FTop, w, h);
+ end;
end;
procedure TfpgX11Window.DoSetMouseCursor;