1XGetWindowAttributes(3)         XLIB FUNCTIONS         XGetWindowAttributes(3)
2
3
4

NAME

6       XGetWindowAttributes, XGetGeometry, XWindowAttributes - get current
7       window attribute or geometry and current window attributes structure
8

SYNTAX

10       Status XGetWindowAttributes(Display *display, Window w, XWindowAt‐
11              tributes *window_attributes_return);
12
13       Status XGetGeometry(Display *display, Drawable d, Window *root_return,
14              int *x_return, int *y_return, unsigned int *width_return,
15              unsigned int *height_return, unsigned int *border_width_return,
16              unsigned int *depth_return);
17

ARGUMENTS

19       border_width_return
20                 Returns the border width in pixels.
21
22       d         Specifies the drawable, which can be a window or a pixmap.
23
24       depth_return
25                 Returns the depth of the drawable (bits per pixel for the
26                 object).
27
28       display   Specifies the connection to the X server.
29
30       root_return
31                 Returns the root window.
32
33       w         Specifies the window whose current attributes you want to
34                 obtain.
35
36       width_return
37       height_return
38                 Return the drawable's dimensions (width and height).
39
40       window_attributes_return
41                 Returns the specified window's attributes in the XWindowAt‐
42                 tributes structure.
43
44       x_return
45       y_return  Return the x and y coordinates that define the location of
46                 the drawable.  For a window, these coordinates specify the
47                 upper-left outer corner relative to its parent's origin.  For
48                 pixmaps, these coordinates are always zero.
49

DESCRIPTION

51       The XGetWindowAttributes function returns the current attributes for
52       the specified window to an XWindowAttributes structure.  It returns a
53       nonzero status on success; otherwise, it returns a zero status.
54
55       XGetWindowAttributes can generate BadDrawable and BadWindow errors.
56
57       The XGetGeometry function returns the root window and the current geom‐
58       etry of the drawable.  The geometry of the drawable includes the x and
59       y coordinates, width and height, border width, and depth.  These are
60       described in the argument list.  It is legal to pass to this function a
61       window whose class is InputOnly.  It returns a nonzero status on suc‐
62       cess; otherwise, it returns a zero status.
63

STRUCTURES

65       The XWindowAttributes structure contains:
66
67       typedef struct {
68            int x, y;                /* location of window */
69            int width, height;       /* width and height of window */
70            int border_width;        /* border width of window */
71            int depth;               /* depth of window */
72            Visual *visual;          /* the associated visual structure */
73            Window root;             /* root of screen containing window */
74            int class;               /* InputOutput, InputOnly*/
75            int bit_gravity;         /* one of the bit gravity values */
76            int win_gravity;         /* one of the window gravity values */
77            int backing_store;       /* NotUseful, WhenMapped, Always */
78            unsigned long backing_planes;/* planes to be preserved if possible */
79            unsigned long backing_pixel;/* value to be used when restoring planes */
80            Bool save_under;         /* boolean, should bits under be saved? */
81            Colormap colormap;       /* color map to be associated with window */
82            Bool map_installed;      /* boolean, is color map currently installed*/
83            int map_state;           /* IsUnmapped, IsUnviewable, IsViewable */
84            long all_event_masks;    /* set of events all people have interest in*/
85            long your_event_mask;    /* my event mask */
86            long do_not_propagate_mask;/* set of events that should not propagate */
87            Bool override_redirect;  /* boolean value for override-redirect */
88            Screen *screen;          /* back pointer to correct screen */
89       } XWindowAttributes;
90
91       The x and y members are set to the upper-left outer corner relative to
92       the parent window's origin.  The width and height members are set to
93       the inside size of the window, not including the border.  The bor‐
94       der_width member is set to the window's border width in pixels.  The
95       depth member is set to the depth of the window (that is, bits per pixel
96       for the object).  The visual member is a pointer to the screen's asso‐
97       ciated Visual structure.  The root member is set to the root window of
98       the screen containing the window.  The class member is set to the win‐
99       dow's class and can be either InputOutput or InputOnly.
100
101       The bit_gravity member is set to the window's bit gravity and can be
102       one of the following:
103
104       ForgetGravity     EastGravity
105       NorthWestGrav‐    SouthWestGrav‐
106       ity               ity
107       NorthGravity      SouthGravity
108       NorthEastGrav‐    SouthEastGrav‐
109       ity               ity
110       WestGravity       StaticGravity
111       CenterGravity
112
113       The win_gravity member is set to the window's window gravity and can be
114       one of the following:
115
116       UnmapGravity      EastGravity
117       NorthWestGrav‐    SouthWestGrav‐
118       ity               ity
119       NorthGravity      SouthGravity
120       NorthEastGrav‐    SouthEastGrav‐
121       ity               ity
122       WestGravity       StaticGravity
123       CenterGravity
124
125       For additional information on gravity, see section 3.3.
126
127       The backing_store member is set to indicate how the X server should
128       maintain the contents of a window and can be WhenMapped, Always, or
129       NotUseful.  The backing_planes member is set to indicate (with bits set
130       to 1) which bit planes of the window hold dynamic data that must be
131       preserved in backing_stores and during save_unders.  The backing_pixel
132       member is set to indicate what values to use for planes not set in
133       backing_planes.
134
135       The save_under member is set to True or False.  The colormap member is
136       set to the colormap for the specified window and can be a colormap ID
137       or None.  The map_installed member is set to indicate whether the col‐
138       ormap is currently installed and can be True or False.  The map_state
139       member is set to indicate the state of the window and can be IsUn‐
140       mapped, IsUnviewable, or IsViewable.  IsUnviewable is used if the win‐
141       dow is mapped but some ancestor is unmapped.
142
143       The all_event_masks member is set to the bitwise inclusive OR of all
144       event masks selected on the window by all clients.  The your_event_mask
145       member is set to the bitwise inclusive OR of all event masks selected
146       by the querying client.  The do_not_propagate_mask member is set to the
147       bitwise inclusive OR of the set of events that should not propagate.
148
149       The override_redirect member is set to indicate whether this window
150       overrides structure control facilities and can be True or False.  Win‐
151       dow manager clients should ignore the window if this member is True.
152
153       The screen member is set to a screen pointer that gives you a back
154       pointer to the correct screen.  This makes it easier to obtain the
155       screen information without having to loop over the root window fields
156       to see which field matches.
157

DIAGNOSTICS

159       BadDrawable
160                 A value for a Drawable argument does not name a defined Win‐
161                 dow or Pixmap.
162
163       BadWindow A value for a Window argument does not name a defined Window.
164

SEE ALSO

166       XQueryPointer(3), XQueryTree(3)
167       Xlib - C Language X Interface
168
169
170
171X Version 11                     libX11 1.3.4          XGetWindowAttributes(3)
Impressum