XGetGeometry()XGetGeometry()NameXGetGeometry – obtain the current geometry of drawable.
Synopsis
Status XGetGeometry(display, drawable, root_return, x_return, y_return,
width_return, height_return, border_width_return, depth_return)
Display *display;
Drawable drawable;
Window *root_return;
int *x_return, *y_return;
unsigned int *width_return, *height_return;
unsigned int *border_width_return;
unsigned int *depth_return;
Arguments
display Specifies a connection to an X server; returned from
XOpenDisplay().
drawable Specifies the drawable, either a window or a pixmap.
root_return Returns the root window ID of the specified window.
x_return Return the coordinates of the upper-left pixel of the win‐
y_return dow's border, relative to its parent's origin. For
pixmaps, these coordinates are always zero.
width_returnReturn the dimensions of the drawable. For a window, these
height_returreturn the inside size (not including the border).
border_width_return
Returns the borderwidth, in pixels, of the window's border,
if the drawable is a window. Returns zero if the drawable
is a pixmap.
depth_return
Returns the depth of the pixmap or window (bits per pixel
for the object).
Returns
Zero on failure, non-zero on success.
Description
This function gets the current geometry of a drawable, plus the ID of
the root window of the screen the window is on. It is legal to pass to
this function on InputOnly window.
XGetGeometry() returns a Status of zero on failure, or non-zero on suc‐
cess.
Errors
BadDrawable
See AlsoXConfigureWindow(), XGetWindowAttributes(), XMoveResizeWindow(),
XMoveWindow(), XResizeWindow().
Xlib - Window Attributes XGetGeometry()