Zum Hauptinhalt springen

Requests: Window Configuration and Geometry

ConfigureWindow​

window: WINDOW
value-mask: BITMASK
value-list: LISTofVALUE
Errors: Window, Match, Value

Changes the configuration of the window. The value-mask and value-list specify which values are to be given. The possible values are:

x: INT16
y: INT16
width: CARD16
height: CARD16
border-width: CARD16
sibling: WINDOW
stack-mode: {Above, Below, TopIf, BottomIf, Opposite}

The x and y coordinates are relative to the parent's origin, and specify the position of the upper left outer corner of the window. The width and height specify the inside size, not including the border, and must be non-zero. It is a Match error to attempt to make the border-width of an InputOnly window non-zero.

If the override-redirect attribute of the window is False and some other client has selected SubstructureRedirect on the parent, then a ConfigureRequest event is generated, and no further processing is performed. Otherwise, the following is performed.

If some other client has selected ResizeRedirect on the window and the width or height of the window is being changed, then a ResizeRequest event is generated, and the current width and height are used instead in the following.

The geometry of the window is changed as specified and the window is restacked among siblings as described below, and a ConfigureNotify event is generated. If the width or height of the window has actually changed, then children of the window are affected as described below.

Exposure processing is performed on formerly obscured windows.

Changing the width or height of the window causes its contents to be moved or lost, depending on the bit-gravity of the window, and causes children to be reconfigured, depending on their win-gravity. For a change of width and height of W and H, we define the [x, y] pairs:

NorthWest: [0, 0]
North: [W/2, 0]
NorthEast: [W, 0]
West: [0, H/2]
Center: [W/2, H/2]
East: [W, H/2]
SouthWest: [0, H]
South: [W/2, H]
SouthEast: [W, H]

When a window with one of these bit-gravities is resized, the corresponding pair defines the change in position of each pixel in the window. When a window with one of these win-gravities has its parent window resized, the corresponding pair defines the change in position of the window within the parent. When a window is so repositioned, a GravityNotify event is generated.

A gravity of Static indicates that the contents or origin should not move relative to the origin of the root window. If the change in size of the window is coupled with a change in position of [X, Y], then for bit-gravity the change in position of each pixel is [-X, -Y], and for win-gravity the change in position of a child when its parent is so resized is [-X, -Y]. Note that Static gravity still only takes effect when the width or height of the window is changed, not when the window is simply moved.

A bit-gravity of Forget indicates that the window contents are always discarded after a size change; the window is tiled with its background (if no background is defined, the existing screen contents are not altered) and one or more exposure events are generated. A server may also ignore the specified bit-gravity and use Forget instead.

A win-gravity of Unmap is like NorthWest, but the child is also unmapped when the parent is resized, and an UnmapNotify event is generated.

If a sibling and a stack-mode is specified, the window is restacked as follows:

Above:  window is placed just above sibling
Below: window is placed just below sibling
TopIf: if sibling occludes window, then window is placed
at the top of the stack
BottomIf: if window occludes sibling, then window is
           placed at the bottom of the stack
Opposite: if sibling occludes window, then window is
placed at the top of the stack, else if window
occludes sibling, then window is placed at the
bottom of the stack

If a stack-mode is specified but no sibling is specified, the window is restacked as follows:

Above:  window is placed at the top of the stack
Below: window is placed at the bottom of the stack
TopIf: if any sibling occludes window, then window is
placed at the top of the stack
BottomIf: if window occludes any sibling, then window is
placed at the bottom of the stack
Opposite: if any sibling occludes window, then window is
placed at the top of the stack, else if window
occludes any sibling, then window is placed at
the bottom of the stack

It is a Match error if a sibling is specified without a stack-mode, or if the window is not actually a sibling.

Note that the computations for BottomIf, TopIf, and Opposite are performed with respect to the window's final geometry (as controlled by the other arguments to the request), not its initial geometry.

CirculateWindow​

window: WINDOW
direction: {RaiseLowest, LowerHighest}
Errors: Window, Value

If some other client has selected SubstructureRedirect on the window, then a CirculateRequest event is generated, and no further processing is performed. Otherwise, the following is performed, and then a CirculateNotify event is generated if the window is actually restacked.

For RaiseLowest, raises the lowest mapped child (if any) that is occluded by another child to the top of the stack. For LowerHighest, lowers the highest mapped child (if any) that occludes another child to the bottom of the stack. Exposure processing is performed on formerly obscured windows.

GetGeometry​

drawable: DRAWABLE

=>

root: WINDOW
depth: CARD8
x, y: INT16
width, height, border-width: CARD16
Errors: Drawable

Returns the root and (current) geometry of the drawable. Depth is the number of bits per pixel for the object. X, y, and border-width will always be zero for pixmaps. For a window, the x and y coordinates specify the upper left outer corner of the window relative to its parent's origin, and the width and height specify the inside size (not including the border).

It is legal to pass an InputOnly window as a drawable to this request.

QueryTree​

window: WINDOW

=>

root: WINDOW
parent: WINDOW or None
children: LISTofWINDOW
Errors: Window

Returns the root, the parent, and children of the window. The children are listed in bottom-to-top stacking order.