XChangeWindowAttributes, XSetWindowBackground, XSetWindowBackgroundPixmap, XSetWindowBorder, XSetWindowBorderPixmap, XSetWindowColormap − change window attributes


int XChangeWindowAttributes(Display *display, Window w, unsigned long valuemask, XSetWindowAttributes *attributes);

int XSetWindowBackground(Display *display, Window w, unsigned long background_pixel);

int XSetWindowBackgroundPixmap(Display *display, Window w, Pixmap background_pixmap);

int XSetWindowBorder(Display *display, Window w, unsigned long border_pixel);

int XSetWindowBorderPixmap(Display *display, Window w, Pixmap border_pixmap);

int XSetWindowColormap(Display *display, Window w, Colormap colormap);



Specifies the structure from which the values (as specified by the value mask) are to be taken. The value mask should have the appropriate bits set to indicate which attributes have been set in the structure.


Specifies the pixel that is to be used for the background.


Specifies the background pixmap, ParentRelative, or None.


Specifies the entry in the colormap.


Specifies the border pixmap or CopyFromParent.


Specifies the connection to the X server.


Specifies which window attributes are defined in the attributes argument. This mask is the bitwise inclusive OR of the valid attribute mask bits. If valuemask is zero, the attributes are ignored and are not referenced.


Specifies the window.


Specifies the colormap.


Depending on the valuemask, the XChangeWindowAttributes function uses the window attributes in the XSetWindowAttributes structure to change the specified window attributes. Changing the background does not cause the window contents to be changed. To repaint the window and its background, use XClearWindow. Setting the border or changing the background such that the border tile origin changes causes the border to be repainted. 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. 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, or changing the backing-planes, backing-pixel, or save-under of a mapped window may have no immediate effect. Changing the colormap of a window (that is, defining a new map, not changing the contents of the existing map) generates a ColormapNotify event. Changing the colormap of a visible window may have no immediate effect on the screen because the map may not be installed (see XInstallColormap). Changing the cursor of a root window to None restores the default cursor. Whenever possible, you are encouraged to share colormaps.

Multiple clients can select input on the same window. Their event masks are maintained separately. When an event is generated, it is reported to all interested clients. However, only one client at a time can select for SubstructureRedirectMask, ResizeRedirectMask, and ButtonPressMask. If a client attempts to select any of these event masks and some other client has already selected one, a BadAccess error results. There is only one do-not-propagate-mask for a window, not one per client.

XChangeWindowAttributes can generate BadAccess, BadColor, BadCursor, BadMatch, BadPixmap, BadValue, and BadWindow errors.

The XSetWindowBackground function sets the background of the window to the specified pixel value. Changing the background does not cause the window contents to be changed. XSetWindowBackground uses a pixmap of undefined size filled with the pixel value you passed. If you try to change the background of an InputOnly window, a BadMatch error results.

XSetWindowBackground can generate BadMatch and BadWindow errors.

The XSetWindowBackgroundPixmap function sets the background pixmap of the window to the specified pixmap. The background pixmap can immediately be freed if no further explicit references to it are to be made. If ParentRelative is specified, the background pixmap of the window’s parent is used, or on the root window, the default background is restored. If you try to change the background of an InputOnly window, a BadMatch error results. If the background is set to None, the window has no defined background.

XSetWindowBackgroundPixmap can generate BadMatch, BadPixmap, and BadWindow errors.

The XSetWindowBorder function sets the border of the window to the pixel value you specify. If you attempt to perform this on an InputOnly window, a BadMatch error results.

XSetWindowBorder can generate BadMatch and BadWindow errors.

The XSetWindowBorderPixmap function sets the border pixmap of the window to the pixmap you specify. The border pixmap can be freed immediately if no further explicit references to it are to be made. If you specify CopyFromParent, a copy of the parent window’s border pixmap is used. If you attempt to perform this on an InputOnly window, a BadMatch error results.

XSetWindowBorderPixmap can generate BadMatch, BadPixmap, and BadWindow errors.

The XSetWindowColormap function sets the specified colormap of the specified window. The colormap must have the same visual type as the window, or a BadMatch error results.

XSetWindowColormap can generate BadColor, BadMatch, and BadWindow errors.



A client attempted to free a color map entry that it did not already allocate.


A client attempted to store into a read-only color map entry.


A value for a Colormap argument does not name a defined Colormap.


A value for a Cursor argument does not name a defined Cursor.


Some argument or pair of arguments has the correct type and range but fails to match in some other way required by the request.


An InputOnly window locks this attribute.


A value for a Pixmap argument does not name a defined Pixmap.


Some numeric value falls outside the range of values accepted by the request. Unless a specific range is specified for an argument, the full range defined by the argument’s type is accepted. Any argument defined as a set of alternatives can generate this error.


A value for a Window argument does not name a defined Window.


XConfigureWindow(3), XCreateWindow(3), XDestroyWindow(3), XInstallColormap(3), XMapWindow(3), XRaiseWindow(3), XUnmapWindow(3)
Xlib − C Language X Interface

More Linux Commands

Tcl_MakeFileChannel(3) - buffered I/O facilities using chann
The Tcl channel mechanism provides a device-independent and platform-independent mechanism for performing buffered input and output operations on a variety of f

Cyrus::IMAP(3pm) - Interface to Cyrus imclient library......
The Cyrus::IMAP module provides an interface to the Cyrus imclient library. These are primarily useful for implementing cyradm operations within a Perl script;

XtCallCallbacks(3) - process callbacks - Linux manual page
The XtCallCallbacks function calls each procedure that is registered in the specified widgets callback list. If callbacks is not NULL, XtCallCallbackList calls

sqrt(3) - square root function (Library - Linux man page)...
The sqrt() function returns the nonnegative square root of x. RETURN VALUE On success, these functions return the square root of x. If x is a NaN, a NaN is retu

gluQuadricCallback(3gl) - define a callback for a quadrics o
gluQuadricCallback is used to define a new callback to be used by a quadrics object. If the specified callback is already defined, then it is replaced. If CallB

XkbAllocDeviceInfo(3) - Obtain an XkbDeviceInfoRec structure
XkbAllocDeviceInfo allocates space for an XkbDeviceInfoRec structure and initializes that structures device_spec field with the device ID specified by device_sp

unix_update(8) - Helper binary that updates the password of
unix_update is a helper program for the pam_unix module that updates the password of a given user. It is not intended to be run directly from the command line a

perlsource(1) - A guide to the Perl source tree (Man Page)
This document describes the layout of the Perl source tree. If youre hacking on the Perl core, this will help you find what youre looking for. FINDING YOUR WAY

XFillRectangles(3) - fill rectangles, polygons, or arcs.....
The XFillRectangle and XFillRectangles functions fill the specified rectangle or rectangles as if a four-point FillPolygon protocol request were specified for e

XCheckIfEvent(3) - check the event queue with a predicate pr
The XIfEvent function completes only when the specified predicate procedure returns True for an event, which indicates an event in the queue matches. XIfEvent f

alphasort(3) - scan a directory for matching entries........
alphasort.3 - The scandir() function scans the directory dirp, calling filter() on each directory entry. Entries for which filter() returns nonzero are stored i

podofocolor(1) modify colors in a PDF file. - Linux man page
podofocolor.1 - podofocolor is one of the command line tools from the PoDoFo library that provide several useful operations to work with colors in PDF files. It

We can't live, work or learn in freedom unless the software we use is free.