跳到主要内容

请求:窗口配置与几何结构

ConfigureWindow​

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

更改该窗口的配置。value-mask 与 value-list 指定要给出的值。可取值为:

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

x 与 y 坐标相对于父窗口的原点,指定窗口左上外角的位置。width 与 height 指定内部尺寸,不包括边框,且必须非零。试图把 InputOnly 窗口的 border-width 设为非零是 Match 错误。

如果该窗口的 override-redirect 属性为 False,并且其他某个客户端在父窗口上选择了 SubstructureRedirect,则生成 ConfigureRequest 事件,并且不再进行后续处理。否则执行以下操作。

如果其他某个客户端在该窗口上选择了 ResizeRedirect,并且正在更改该窗口的 width 或 height,则生成 ResizeRequest 事件,并在以下处理中改用当前的 width 与 height。

按指定方式更改该窗口的几何结构,并按下述方式在同级窗口中重新层叠该窗口,同时生成 ConfigureNotify 事件。如果该窗口的 width 或 height 确实发生了变化,则该窗口的子窗口会按下述方式受到影响。

对先前被遮挡的窗口执行暴露处理。

更改窗口的 width 或 height 会根据该窗口的 bit-gravity 决定其内容是被移动还是丢失,并根据子窗口的 win-gravity 决定子窗口如何重新配置。对于 width 与 height 分别为 W 和 H 的变化,我们定义如下 [x, y] 对:

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]

当具有上述某个 bit-gravity 的窗口被调整大小时,对应的那一对值定义窗口中每个像素的位置变化。当具有上述某个 win-gravity 的窗口的父窗口被调整大小时,对应的那一对值定义该窗口在父窗口内的位置变化。当窗口以这种方式重新定位时,会生成 GravityNotify 事件。

重力位为 Static 表示内容或原点相对于根窗口的原点不应移动。如果窗口尺寸的变化伴随着位置 [X, Y] 的变化,那么对于 bit-gravity,每个像素的位置变化为 [-X, -Y];对于 win-gravity,当父窗口以这种方式被调整大小时,子窗口的位置变化为 [-X, -Y]。请注意,Static 重力位仍然只在窗口的 width 或 height 发生变化时才起作用,而不会在窗口仅被移动时起作用。

bit-gravity 为 Forget 表示窗口内容在尺寸变化后总是被丢弃;该窗口会用其背景填充(如果未定义背景,则不改动屏幕上已有的内容),并生成一个或多个暴露事件。服务器也可以忽略指定的 bit-gravity 而改用 Forget。

win-gravity 为 Unmap 与 NorthWest 类似,但当父窗口被调整大小时该子窗口还会被取消映射,并生成 UnmapNotify 事件。

如果同时指定了 sibling 和 stack-mode,则该窗口按如下方式重新层叠:

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

如果指定了 stack-mode 但未指定 sibling,则该窗口按如下方式重新层叠:

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

在未指定 stack-mode 的情况下指定 sibling,或者该窗口实际上并非同级窗口,都是 Match 错误。

请注意,BottomIf、TopIf 和 Opposite 的计算是相对于该窗口的最终几何结构(由该请求的其他参数决定)进行的,而不是相对于其初始几何结构。

CirculateWindow​

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

如果其他某个客户端在该窗口上选择了 SubstructureRedirect,则生成 CirculateRequest 事件,并且不再进行后续处理。否则执行以下操作,并且如果该窗口确实被重新层叠,则生成 CirculateNotify 事件。

对于 RaiseLowest,把最低的、被其他子窗口遮挡的已映射子窗口(如果有)提升到层叠顺序的顶部。对于 LowerHighest,把最高的、遮挡了其他子窗口的已映射子窗口(如果有)降到层叠顺序的底部。对先前被遮挡的窗口执行暴露处理。

GetGeometry​

drawable: DRAWABLE

=>

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

返回该可绘制对象的 root 及其(当前)几何结构。depth 是该对象的每像素位数。对 pixmap 而言,x、y 和 border-width 总是为零。对窗口而言,x 与 y 坐标指定窗口左上外角相对于其父窗口原点的位置,width 与 height 指定内部尺寸(不包括边框)。

把 InputOnly 窗口作为可绘制对象传递给该请求是合法的。

QueryTree​

window: WINDOW

=>

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

返回该窗口的 root、父窗口和子窗口。子窗口按自底向上的层叠顺序列出。