XChangeWindowAttributes()XChangeWindowAttributes()NameXChangeWindowAttributes – set window attributes.
Synopsis
XChangeWindowAttributes(display, w, valuemask, attributes)
Display *display;
Window w;
unsigned long valuemask;
XSetWindowAttributes *attributes;
Arguments
display Specifies a connection to an X server; returned from
XOpenDisplay().
w Specifies the window ID.
valuemask Specifies which window attributes are defined in the
attributes argument. The mask is made by combining the
appropriate mask symbols listed in the Structures section
using bitwise OR ( ). If valuemask is zero, the rest is
ignored, and attributes is not referenced. The values and
restrictions are the same as for XCreateWindow().
attributes
Window attributes to be changed. The valuemask indicates
which members in this structure are referenced.
DescriptionXChangeWindowAttributes() changes any or all of the window attributes
that can be changed. For descriptions of the window attributes, see
Volume One, Chapter 4, Window Attributes.
Changing the background does not cause the window contents to be
changed until the next Expose event or XClearWindow() call. Setting
the border causes the border to be repainted immediately. Changing the
background of a root window to None or ParentRelative restores the
default background pixmap. Changing the border of a root window to
CopyFromParent restores the default border pixmap. Drawing into the
pixmap that was set as the background pixmap or border pixmap attribute
has an undefined effect, because the server may or may not make copies
of these pixmaps.
Changing the win_gravity does not affect the current position of the
window. Changing the backing_store of an obscured window to WhenMapped
or Always may have no immediate effect. Also changing the back‐
ing_planes, backing_pixel, or save_under of a mapped window may have no
immediate effect.
Multiple clients can select input on the same window; the event_mask
attributes passed are disjoint. When an event is generated it will be
reported to all interested clients. Therefore, the setting of the
event_mask attribute by one client will not affect the event_mask of
others on the same window. However, at most, one client at a time can
select each of SubstructureRedirectMask, ResizeRedirectMask, and But‐
tonPressMask on any one window. If a client attempts to select on Sub‐
tructureRedirectMask, ResizeRedirectMask, or ButtonPressMask and some
other client has already selected it on the same window, the X server
generates a BadAccess error.
There is only one do_not_propagate_mask for a window, not one per
client.
Changing the colormap attribute of a window generates a ColormapNotify
event. Changing the colormap attribute of a visible window may have no
immediate effect on the screen (because the colormap may not be
installed until the window manager calls XInstallColormap()).
Changing the cursor of a root window to None restores the default cur‐
sor.
For more information, see Volume One, Chapter 2, X Concepts, and Chap‐
ter 4, Window Attributes.
Structures
/*
* Data structure for setting window attributes.
*/
typedef struct {
Pixmap background_pixmap; /* pixmap, None, or ParentRelative */
unsigned long background_pixel; /* background pixel */
Pixmap border_pixmap; /* pixmap, None, or CopyFromParent */
unsigned long border_pixel; /* border pixel value */
int bit_gravity; /* one of bit gravity values */
int win_gravity; /* one of the window gravity values */
int backing_store; /* NotUseful, WhenMapped, Always */
unsigned long backing_planes; /* planes to be preseved if possible */
unsigned long backing_pixel; /* value to use in restoring planes */
Bool save_under; /* should bits under be saved (popups) */
long event_mask; /* set of events that should be saved */
long do_not_propagate_mask; /* set of events that should not
propagate */
Bool override_redirect; /* override redirected config request */
Colormap colormap; /* colormap to be associated with window */
Cursor cursor; /* cursor to be displayed (or None) */
} XSetWindowAttributes;
/* Definitions for valuemask argument of CreateWindow and
ChangeWindowAttributes */
#define CWBackPixmap (1L<<0)
#define CWBackPixel (1L<<1)
#define CWBorderPixmap (1L<<2)
#define CWBorderPixel (1L<<3)
#define CWBitGravity (1L<<4)
#define CWWinGravity (1L<<5)
#define CWBackingStore (1L<<6)
#define CWBackingPlanes (1L<<7)
#define CWBackingPixel (1L<<8)
#define CWOverrideRedirect (1L<<9)
#define CWSaveUnder (1L<<10)
#define CWEventMask (1L<<11)
#define CWDontPropagate (1L<<12)
#define CWColormap (1L<<13)
#define CWCursor (1L<<14)
Errors
BadAccess
BadColor Specified colormap is invalid.
BadCursor
BadMatch
BadPixmap
BadValue
BadWindow
See AlsoXGetGeometry(), XGetWindowAttributes(), XSetWindowBackground(),
XSetWindowBackgroundPixmap(), XSetWindowBorder(), XSetWindowBorder‐
Pixmap().
Xlib - Window Attributes XChangeWindowAttributes()