Re: move/resize handling again



On Mon, 2002-11-11 at 23:55, Havoc Pennington wrote:
> 
> I'm probably being dense, but when does it matter, aside from
> metacity's funky constraints code (which I have an elaborate plan to
> change, see src/constraints.c)
> 

Assume the window has origin 50, 50, size 100, 100 and gravity
SouthWest. For simplicity assume the wm puts a 5 pixel frame around the 
window, so that the frame origin is 45, 45 and its size is 110, 110. The
reference point is where the southwest corner of the frame is: 155, 155.

In this scenario, an XMoveWindow (win, 55, 55) will leave the window 
in place, since the WM calculates the new reference point 155, 155 and
then place the southwest corner of the frame there, ending up with the 
frame origin at 45, 45 as before.

A XResizeWindow (110, 110) will leave the reference point unchanged, the
new frame size will be 120, 120, so the new frame origin will be at 
35, 35 and the new window origin will be at 40, 40.

Lets consider XMoveResize(55, 55, 110, 110) now. First interpretation:

move, resize: in the move step, the window doesn't change its position,
so we end up with the same result as for the resize alone: frame origin
35, 35.

resize, move: after the resize step, we have window origin 40, 40, size
110, 110, frame origin 35, 35, size 120, 120. Now we do a move to 55,
55. First calculate the new reference point as 165, 165. Now move the
frame reference point there. The result is a frame origin of 45, 45.   

See the difference ?

Matthias




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