Package: gdk

Function gdk-window-geometry

Lambda List

gdk-window-geometry (window)

Arguments

window -- a gdk-window object

Return Value

x -- a :int with the x coordinate of window, relative to its parent
y -- a :int with the y coordinate of window, relative to its parent
width -- a :int with the width of window
height -- a :int 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 function gdk-window-position 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 functions gdk-window-position, gdk-window-width and gdk-window-height instead, because it avoids the roundtrip to the X server and because these functions support the full 32-bit coordinate space, whereas the function gdk-window-geometry is restricted to the 16-bit coordinates of X11.
 

See also

2020-9-7