From 9d8521dfe8afdcaee1178d80e957ae591d0c10ed Mon Sep 17 00:00:00 2001 From: mattias Date: Sun, 25 Apr 2010 14:29:58 +0000 Subject: [PATCH] LCL: TWinControl.ClientRectNeedsInterfaceUpdate: consider LCL-interface difference in size git-svn-id: trunk@24915 - --- lcl/include/wincontrol.inc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lcl/include/wincontrol.inc b/lcl/include/wincontrol.inc index b21205a2e4..634eb20b56 100644 --- a/lcl/include/wincontrol.inc +++ b/lcl/include/wincontrol.inc @@ -3700,6 +3700,7 @@ end; -------------------------------------------------------------------------------} function TWinControl.ClientRectNeedsInterfaceUpdate: boolean; var + InterfaceWidth, InterfaceHeight: integer; IntfClientRect: TRect; begin if (not HandleAllocated) or (csDestroyingHandle in ControlState) @@ -3708,9 +3709,18 @@ begin exit(false); if wcfClientRectNeedsUpdate in FWinControlFlags then exit(true); + // get the current interface bounds + LCLIntf.GetWindowSize(Handle,InterfaceWidth,InterfaceHeight); LCLIntf.GetClientRect(Handle,IntfClientRect); + // The LCL is not always in sync with the interface. + // Add the difference between LCL size and interface size to the + // interface clientrect + inc(IntfClientRect.Right,Width-InterfaceWidth); + inc(IntfClientRect.Bottom,Height-InterfaceHeight); Result:=(FClientWidth<>IntfClientRect.Right) or (FClientHeight<>IntfClientRect.Bottom); + if Result then + Include(FWinControlFlags,wcfClientRectNeedsUpdate); end; {-------------------------------------------------------------------------------