From 4a1011a4b202e800c04b08a6919c23531bf4988c Mon Sep 17 00:00:00 2001 From: matthiasc Date: Wed, 27 Nov 2002 19:23:24 +0000 Subject: Rewrote some implementation notes for more clarity. --- wm-spec/wm-spec.sgml | 228 +++++++++++++++++++++++++++------------------------ 1 file changed, 122 insertions(+), 106 deletions(-) diff --git a/wm-spec/wm-spec.sgml b/wm-spec/wm-spec.sgml index 8f54a80..f3e46cf 100644 --- a/wm-spec/wm-spec.sgml +++ b/wm-spec/wm-spec.sgml @@ -1,6 +1,6 @@ - + + ]>
@@ -1279,7 +1279,8 @@ unlikely to break anything, it seems reasonable to document it as standard. Urgency - Dialog boxes should indicate their urgency level (information or warning) using the urgency bit in the WM_HINTS.flags property, as defined in the ICCCM. +Windows expecting immediate user action should indicate this using the +urgency bit in the WM_HINTS.flags property, as defined in the ICCCM. @@ -1339,7 +1340,7 @@ unlikely to break anything, it seems reasonable to document it as standard. - Window Movement + Window Geometry Window manager implementors should refer to the ICCCM for definitive specifications of how to handle MapRequest and ConfigureRequest events. @@ -1348,40 +1349,114 @@ document offers the following clarifications: -Window managers MUST honor the win_gravity field of WM_NORMAL_HINTS - for both MapRequest _and_ ConfigureRequest events (ICCCM Version 2.0, - §4.1.2.3 and §4.1.5) +Window Managers MUST honor the win_gravity field of WM_NORMAL_HINTS +for both MapRequest and ConfigureRequest events +(ICCCM Version 2.0, §4.1.2.3 and §4.1.5) +When generating synthetic ConfigureNotify events, the position given +MUST be the top-left corner of the client window in relation to the +origin of the root window (i.e., ignoring win_gravity) +(ICCCM Version 2.0, §4.2.3) + + +Window Managers maintain a reference point for each client window and place +the window relative to this reference point depending on the window's +win_gravity as follows: + + + + + + win_gravity: + placed at the reference point + + + StaticGravity + the left top corner of the client window + + + NorthWestGravity + the left top corner of the frame window + + + NorthGravity + the center of the frame window's top side + + + NorthEastGravity + the right top corner of the frame window + + + EastGravity + the center of the frame window's right side + + + SouthEastGravity + the right bottom corner of the frame window + + + SouthGravity + the center of the frame window's bottom side + + + SouthWestGravity + the left bottom corner of the frame window + + + WestGravity + the center of the frame window's left side + + + CenterGravity + the center of the frame window + + + + + + Applications are free to change their win_gravity setting at any time. -If an application changes its gravity then the Window Manager should adjust the -reference point, so that the client window will not move as the result. -For example if Client's gravity was NorthWestGravity and reference point -was -at the top-left corner of the frame window, then after change of gravity to -the SouthEast reference point should be adjusted to point to the -lower-right -corner of the frame. - - -When generating synthetic ConfigureNotify events, the position given - MUST be the top-left corner of the client window in relation to the - origin of the root window (i.e., ignoring win_gravity) (ICCCM Version 2.0, §4.2.3) - +If an Application changes its win_gravity then the Window Manager should +adjust the reference point, so that the client window will not move as the +result. For example if the Application's win_gravity was NorthWestGravity and +reference point was at the top-left corner of the frame window, then after +change of win_gravity to SouthEastGravity the reference point should be +adjusted to point to the lower-right corner of the frame. + + + +Changing the win_gravity for a single configure request and back afterwards is +unlikely to work as intended, due to a race condition. The window manager sees +a property notify for WM_NORMAL_HINTS, followed by the configure request, +followed by another property notify for WM_NORMAL_HINTS. By the time the +window manager gets around to request the changed WM_NORMAL_HINTS in response +to the first property notify, the server may have already processed the second +property change. + + +If the window manager supports it, applications should use +_NET_MOVERESIZE_WINDOW with a specified gravity to avoid this problem. + + + -XMoveWindow(w,x,y) behavior depends on the window gravity. Upon receiving a -request from a client application the Window Manager calculates a new reference -point, based on the client window's own size, border width and gravity. -For any given client window dimensions (width, height) and border width (bw), the reference point will be -placed at: +If the Application requests a new position (x, y) (and possibly also a +new size), the Window Manager calculates a new reference point (ref_x, ref_y), +based on the client window's (possibly new) size (width, height), border +width (bw) and win_gravity as explained in the table below. + + +The Window Manager will use the new reference point until the next request for +a new position. - Gravity: + win_gravity: ref_x: ref_y: @@ -1437,90 +1512,18 @@ placed at: - - -The Window Manager will use the reference point as calculated above, -until the next XMoveWindow request. The Window Manager will place frame decorations -in the following position, based on the window gravity : - - -StaticGravity: - - -window's left top corner will be placed at (ref_x,ref_y) - - -NorthWestGravity: - - -window frame's left top corner will be placed at (ref_x,ref_y) - - -NorthGravity: - - -window frame's top side's center will be placed at (ref_x,ref_y) - - -NorthEastGravity: - - -window frame's right top corner will be placed at (ref_x,ref_y) - - -EastGravity: - - -window frame's right side's center will be placed at (ref_x,ref_y) - - -SouthWestGravity: - - -window frame's left bottom corner will be placed at (ref_x,ref_y) - - -SouthGravity: - - -window frame's bottom side's center will be placed at (ref_x,ref_y) - - -SouthEastGravity: - - -window frame's right bottom corner will be placed at (ref_x,ref_y) - - -WestGravity: - - -window frame's left side's center will be placed at (ref_x,ref_y) - - -CenterGravity: - - -window frame's center will be placed at (ref_x,ref_y) - -Implementation Note for Application developers: - - -When a client window is resized - its reference point does not move. -So for example if window has SouthEastGravity and it is resized - -the bottom-right corner of its frame will not move but instead -top-left corner will be adjusted by the difference in size. +If an Application requests just a new size, its reference point does not +move. So for example if client window has win_gravity SouthEastGravity and +is resized, the bottom right corner of its frame will not move but instead +the top left corner will be adjusted by the difference in size. -Implementation Note for window manager developers: - - -When calculating the reference point at the time of initial placement - -the initial window's width should be taken into consideration, as if it -was the frame for this window. +When calculating the reference point at the time of initial placement, +the Window Manager should take the initial window's size into consideration, +as if it was the frame for this window. @@ -1690,6 +1693,19 @@ OR OTHER DEALINGS IN THE SOFTWARE. Change history + + Changes since 1.2 + + +Rewrote the implementation notes on "Window Movement", retitled it +to "Window Geometry". + + +Rewrote the implementation notes on "Urgency", making it clear that +the hint is not just about dialogs. + + + Changes since 1.1 -- cgit v1.2.3-70-g09d2