1XGetWindowAttributes(3X11) XLIB FUNCTIONS XGetWindowAttributes(3X11)
2
3
4
6 XGetWindowAttributes, XGetGeometry, XWindowAttributes - get current
7 window attribute or geometry and current window attributes structure
8
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
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
51 The XGetWindowAttributes function returns the current attributes for
52 the specified window to an XWindowAttributes structure.
53
54 XGetWindowAttributes can generate BadDrawable and BadWindow errors.
55
56 The XGetGeometry function returns the root window and the current geom‐
57 etry of the drawable. The geometry of the drawable includes the x and
58 y coordinates, width and height, border width, and depth. These are
59 described in the argument list. It is legal to pass to this function a
60 window whose class is InputOnly.
61
63 The XWindowAttributes structure contains:
64
65 typedef struct {
66 int x, y; /∗ location of window */
67 int width, height; /∗ width and height of window */
68 int border_width; /∗ border width of window */
69 int depth; /∗ depth of window */
70 Visual *visual; /∗ the associated visual structure */
71 Window root; /∗ root of screen containing window */
72 int class; /∗ InputOutput, InputOnly*/
73 int bit_gravity; /∗ one of the bit gravity values */
74 int win_gravity; /∗ one of the window gravity values */
75 int backing_store; /∗ NotUseful, WhenMapped, Always */
76 unsigned long backing_planes;/∗ planes to be preserved if possible */
77 unsigned long backing_pixel;/∗ value to be used when restoring planes */
78 Bool save_under; /∗ boolean, should bits under be saved? */
79 Colormap colormap; /∗ color map to be associated with window */
80 Bool map_installed; /∗ boolean, is color map currently installed*/
81 int map_state; /∗ IsUnmapped, IsUnviewable, IsViewable */
82 long all_event_masks; /∗ set of events all people have interest in*/
83 long your_event_mask; /∗ my event mask */
84 long do_not_propagate_mask;/∗ set of events that should not propagate */
85 Bool override_redirect; /∗ boolean value for override-redirect */
86 Screen *screen; /∗ back pointer to correct screen */
87 } XWindowAttributes;
88
89 The x and y members are set to the upper-left outer corner relative to
90 the parent window's origin. The width and height members are set to
91 the inside size of the window, not including the border. The bor‐
92 der_width member is set to the window's border width in pixels. The
93 depth member is set to the depth of the window (that is, bits per pixel
94 for the object). The visual member is a pointer to the screen's asso‐
95 ciated Visual structure. The root member is set to the root window of
96 the screen containing the window. The class member is set to the win‐
97 dow's class and can be either InputOutput or InputOnly.
98
99 The bit_gravity member is set to the window's bit gravity and can be
100 one of the following:
101
102 ForgetGravity EastGravity
103 NorthWestGrav‐ SouthWestGrav‐
104 ity ity
105 NorthGravity SouthGravity
106 NorthEastGrav‐ SouthEastGrav‐
107 ity ity
108 WestGravity StaticGravity
109 CenterGravity
110
111 The win_gravity member is set to the window's window gravity and can be
112 one of the following:
113
114 UnmapGravity EastGravity
115 NorthWestGrav‐ SouthWestGrav‐
116 ity ity
117 NorthGravity SouthGravity
118 NorthEastGrav‐ SouthEastGrav‐
119 ity ity
120 WestGravity StaticGravity
121 CenterGravity
122
123 For additional information on gravity, see section 3.3.
124
125 The backing_store member is set to indicate how the X server should
126 maintain the contents of a window and can be WhenMapped, Always, or
127 NotUseful. The backing_planes member is set to indicate (with bits set
128 to 1) which bit planes of the window hold dynamic data that must be
129 preserved in backing_stores and during save_unders. The backing_pixel
130 member is set to indicate what values to use for planes not set in
131 backing_planes.
132
133 The save_under member is set to True or False. The colormap member is
134 set to the colormap for the specified window and can be a colormap ID
135 or None. The map_installed member is set to indicate whether the col‐
136 ormap is currently installed and can be True or False. The map_state
137 member is set to indicate the state of the window and can be IsUn‐
138 mapped, IsUnviewable, or IsViewable. IsUnviewable is used if the win‐
139 dow is mapped but some ancestor is unmapped.
140
141 The all_event_masks member is set to the bitwise inclusive OR of all
142 event masks selected on the window by all clients. The your_event_mask
143 member is set to the bitwise inclusive OR of all event masks selected
144 by the querying client. The do_not_propagate_mask member is set to the
145 bitwise inclusive OR of the set of events that should not propagate.
146
147 The override_redirect member is set to indicate whether this window
148 overrides structure control facilities and can be True or False. Win‐
149 dow manager clients should ignore the window if this member is True.
150
151 The screen member is set to a screen pointer that gives you a back
152 pointer to the correct screen. This makes it easier to obtain the
153 screen information without having to loop over the root window fields
154 to see which field matches.
155
157 BadDrawable
158 A value for a Drawable argument does not name a defined Win‐
159 dow or Pixmap.
160
161 BadWindow A value for a Window argument does not name a defined Window.
162
164 XQueryPointer(3X11), XQueryTree(3X11)
165 Xlib - C Language X Interface
166
167
168
169X Version 11 libX11 1.0.3 XGetWindowAttributes(3X11)