Re: move/resize handling again



As promised, I tried to rewrite Section 7.7 to avoid direct reference to
the C API. I also tried to avoid the confusion that about combined move
and resize that started this thread. I also fixed the last listitem to
refer to the "initial window's size" instead of the "initial window's
width". I ended up reshuffling some listitems in order to introduce the
term "reference point" before using it.
For ease of reviewing, I'll attach a stripped down HTML version of the
rewrite. I you agree that this version is clearer, I'll commit it.
Otherwise I can try for a more limited fixup of that section.

Matthias
<html>
<body>
<H2>7.7. Window Geometry</H2>
<P>Window manager implementors should refer to the ICCCM for definitive
specifications of how to handle MapRequest and ConfigureRequest events.
However, since these aspects of the ICCCM are easily misread, this
document offers the following clarifications:
	</P
><P
></P
><UL
><LI
><P
>Window Managers MUST honor the win_gravity field of WM_NORMAL_HINTS
for both MapRequest <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>and</I
></SPAN
> ConfigureRequest events 
(ICCCM Version 2.0, &sect;4.1.2.3 and &sect;4.1.5)
		</P
></LI
><LI
><P
>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, &sect;4.2.3)
		</P
></LI
><LI
><P
>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:
		</P
><DIV
CLASS="INFORMALTABLE"
><P
></P
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><TBODY
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>win_gravity:</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>placed at the reference point</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>StaticGravity</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>the left top corner of the client window</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>NorthWestGravity</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>the left top corner of the frame window</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>NorthGravity</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>the center of the frame window's top side</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>NorthEastGravity</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>the right top corner of the frame window</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>EastGravity</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>the center of the frame window's right side</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>SouthEastGravity</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>the right bottom corner of the frame window</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>SouthGravity</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>the center of the frame window's bottom side</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>SouthWestGravity</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>the left bottom corner of the frame window</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>WestGravity</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>the center of the frame window's left side</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>CenterGravity</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>the center of the frame window</TD
></TR
></TBODY
></TABLE
><P
></P
></DIV
></LI
><LI
><P
>Applications are free to change their win_gravity setting at any time.
		</P
><P
>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.
		</P
></LI
><LI
><P
>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.
                </P
><P
>The Window Manager will use the new reference point until the next request for 
a new position. 
		</P
><DIV
CLASS="INFORMALTABLE"
><P
></P
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><TBODY
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>win_gravity:</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>ref_x:</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>ref_y:</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>StaticGravity</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>x</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>y</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>NorthWestGravity</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>x-bw</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>y-bw</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>NorthGravity</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>x+(width/2)</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>y-bw</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>NorthEastGravity</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>x+width+bw</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>y-bw</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>EastGravity</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>x+width+bw</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>y+(height/2)</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>SouthEastGravity</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>x+width+bw</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>y+height+bw</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>SouthGravity</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>x+(width/2)</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>y+height+bw</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>SouthWestGravity</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>x-bw</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>y+height+bw</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>WestGravity</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>x-bw</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>y+(height/2)</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>CenterGravity</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>x+(width/2)</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>y+(height/2)</TD
></TR
></TBODY
></TABLE
><P
></P
></DIV
></LI
><LI
><P
>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.
		</P
></LI
><LI
><P
>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.
		</P
></LI
></UL
>
</body>
</html>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]