XConfigureWindow()XConfigureWindow()NameXConfigureWindow – change the window position, size, border width, or
stacking order.
Synopsis
XConfigureWindow(display, w, value_mask, values)
Display *display;
Window w;
unsigned int value_mask;
XWindowChanges *values;
Arguments
display Specifies a connection to an X server; returned from
XOpenDisplay().
w Specifies the ID of the window to be reconfigured.
value_mask
Specifies which values are to be set using information in the
values structure. value_mask is the bitwise OR of any number
of symbols listed in the Structures section below.
values Specifies a pointer to the XWindowChanges structure contain‐
ing new configuration information. See the "Structures" sec‐
tion below.
DescriptionXConfigureWindow() changes the window position, size, border width,
and/or the stacking order. If selected, a ConfigureNotify event is
generated to announce any changes.
If the window to be reconfigured is a top-level window, there will be
interaction with the window manager if the override_redirect attribute
of the window is False. In this case, the X server sends a Configur‐
eRequest event to the window manager and does not reconfigure the win‐
dow. The window manager receives this event and then makes the deci‐
sion whether to allow the application to reconfigure its window. The
client should wait for the ConfigureNotify event to find out the size
and position of the window.
In Release 4, XReconfigureWMWindow() should be used instead of XConfig‐
ureWindow() for top-level windows. This routine properly handles
restacking of top-level windows.
If a window's size actually changes, the window's subwindows may move
according to their window gravity. If they do, GravityNotify events
will be generated for them. Depending on the window's bit gravity, the
contents of the window also may be moved. See Volume One, Chapter 4,
Window Attributes, for further information.
Exposure processing is performed on formerly obscured windows, includ‐
ing the window itself and its inferiors, if regions of them were
obscured but afterward are not. As a result of increasing the width or
height, exposure processing is also performed on any new regions of the
window and any regions where window contents are lost.
The members of XWindowChanges that you specify in values are:
x Specify the x and y coordinates of the upper-left outer cor‐
y ner of the window relative to the parent's origin.
width Specify the inside size of the window in pixels, not includ‐
height ing the border. These arguments must be positive.
border_width
Specifies the width of the border in pixels.
sibling Specifies the sibling window for stacking operations. If
specified, stack_mode must also be specified.
stack_mode
The stack mode can be any of these constants: Above, Below,
TopIf, BottomIf, or Opposite.
The computation for the BottomIf, TopIf, and Opposite stacking modes is
performed with respect to window w's final size and position (as con‐
trolled by the other arguments to XConfigureWindow(), not its initial
position.) It is an error if sibling is specified without stack_mode.
If sibling and stack_mode are specified, the window is restacked as
follows:
Stacking Flag PositionAbove w is placed just above sibling.
Below w is placed just below sibling.
TopIf if sibling occludes w, then w
is placed at the top of the stack.
BottomIf if w occludes sibling, then w
is placed at the bottom of the stack.
Opposite if sibling occludes w, then w
is placed at the top of the stack. If
w occludes sibling, then w is placed
at the bottom of the stack. If w and
sibling do not overlap, no change is made.
If a stack_mode is specified but no sibling is specified, the window is
restacked as follows:Stacking Flag Position
Above w is placed at the top of the stack.
Below w is placed at the bottom of the stack.
TopIf if any sibling occludes w, then w
is placed at the top of the stack.
Stacking Flag Position
BottomIf if w occludes any sibling, then window
is placed at the bottom of the stack.
Opposite if any sibling occludes w, then w
is placed at the top of the stack, else if
w occludes any sibling, then w is placed
at the bottom of the stack.
Under Release 4, use XReconfigureWMWindow() to configure a top-level window.
Structures
typedef struct {
int x, y;
int width, height;
int border_width;
Window sibling;
int stack_mode;
} XWindowChanges;
/* ConfigureWindow structure */
/* ChangeWindow value bits definitions for valuemask */
#define CWX (1<<0)
#define CWY (1<<1)
#define CWWidth (1<<2)
#define CWHeight (1<<3)
#define CWBorderWidth (1<<4)
#define CWSibling (1<<5)
#define CWStackMode (1<<6)
Errors
BadMatch Attempt to set any invalid attribute of InputOnly window.
sibling specified without a stack_mode.
The sibling window is not actually a sibling.
BadValue width or height is 0.
BadWindow
See AlsoXCirculateSubwindows(), XCirculateSubwindowsDown(), XCirculateSubwin‐
dowsUp(), XLowerWindow(), XMoveResizeWindow(), XMoveWindow(), XQuery‐
Tree(), XReconfigureWMWindow(), XRaiseWindow(), XReparentWindow(), XRe‐
sizeWindow(), XRestackWindows().
Xlib - Window Manipulation XConfigureWindow()