Package: gdk

Function gdk:window-geometry

Lambda List

gdk:window-geometry (window)

Arguments

window -- a gdk:window object

Return Value

x -- an integer with the x coordinate of window, relative to its parent
y -- an integer with the y coordinate of window, relative to its parent
width -- an integer with the width of window
height -- an integer with the height of window

Details

The x and y coordinates returned are relative to the parent window of window, which for toplevels usually means relative to the window decorations (titlebar, etc.) rather than relative to the root window (screen-size background window).

On the X11 platform, the geometry is obtained from the X server, so reflects the latest position of the window. This may be out-of-sync with the position of the window delivered in the most-recently-processed gdk:event-configure event. The gdk:window-position function in contrast gets the position from the most recent configure event.

Note

If window is not a toplevel, it is much better to call the gdk:window-position, gdk:window-width and gdk:window-height functions instead, because it avoids the roundtrip to the X server and because these functions support the full 32-bit coordinate space, whereas the gdk:window-geometry function is restricted to the 16-bit coordinates of X11.
 

See also

2023-2-26