4.4 Information from the XWindowAttributes Structure
We have been describing the programmable window attributes stored
in the XSetWindowAttributes structure. Many of the
other window characteristics described in Chapter 2
including the window configuration, are also stored with the window
attributes by the server but are not programmable using
XChangeWindowAttributes(). For example, depth, class,
and visual are assigned at window creation and cannot be changed. The
window size, position, and border width are changed with a separate
mechanism, because for top-level windows there must be cooperation from
the window manager.
The current state of most of the programmable attributes, the
read-only attributes, and the window configuration can be read with
XGetWindowAttributes(). All this information is
returned in an XWindowAttributes structure (not an
XSetWindowAttributes structure).
Example 4-4 shows the fields of
the XWindowAttributes structure that are not present
in XSetWindowAttributes.
Example 4-4. Read-only XWindowAttributes members
typedef struct { /* Members writable with XChangeWindowAttributes omitted */ . . . /* Window geometry -- set by window configuration functions * in cooperation with window manager */ int x, y; /* Location of window */ int width, height; /* Width and height of window */ int border_width; /* Border width of window */ /* This is the event_mask attribute set by XSelectInput */ long your_event_mask; /* My event mask */ /* Set when the window is created, not ...Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access