[Lazarus] GetWindowSize misleading documentation or bug?

Hans-Peter Diettrich DrDiettrich1 at aol.com
Sat Sep 27 11:48:03 CEST 2014

Luca Olivetti schrieb:

> Strange, on mageia 4, kde, lazarus 1.2.4 it doesn't work. What I'm
> trying to do is to tile windows one next to the other. Using
> GetWindowRect under windows I can do it properly, while on linux gtk the
> windows overlap (i.e. with this layout
>      A  B  C
>      D  E
> A overlaps D and B overlaps E, the amount of overlap seems to be equal
> to the height of the title bar).

IIRC the Linux (X11) window managers communicate only the size of the 
client area to the widgetsets, so that attempts to derive the total 
window extent from this information are subject to assumptions about the 
extent of the window "decoration" (caption, theme...). They also don't 
allow (offer no means for) ownerdraw of the NC area of a window.

On Windows instead the owner of a form can paint the entire area of a 
window (in WM_NCPAINT), so that the Windows window manager allows access 
to the full extent of a window. Also note that Windows uses distinct 
windows for every TWinControl, while these are ordinary controls in X11, 
under exclusive management of the widgetset.


More information about the Lazarus mailing list