Suggestion: Gravity and resizing from the left




This is somewhat off-topic on the list, but I'm mailing
it here because the audience of this message is window
manager authors; I'll pretend that it is relevant by
saying that if people agree with my suggestion it could
be added to the spec as "advice to implementors".


When opaque-resizing a window from the left, one frequently
sees "jumping" as center or right-aligned subwindows
are translated to the left and then repositioned into
place. X has a mechanism for controlling such behavior -
window gravity. By using either static gravity or
the appropriate gravity for an aligned element, this
artifact should be controllable.

However, the way most reparenting window managers implement
resizing defeats window gravity. Such window managers
first XMoveResizeWindow() the frame window into the right
place, and then XResizeWindow() the client window to 
the right size.

The correct behavior (in my opinion) is to set 
window gravity for the client window to StaticGravity,
then when a resize occurs. 

 - If the resize makes the window bigger:
   
   1) XMoveResizeWindow the client window to the new size and position
   2) XMoveResizeWindow the frame window to the new size and position

 - If the resize makes the window smaller:

   1) XMoveResizeWindow the frame window to the new size and position
   2) XMoveResizeWindow the client window to the new size and position

 - If the resize does opposite things in the two dimensions, 
   do one of the above sequences arbitrarily - you'll get a bit 
   of flashing around the border, as regions are temporarily exposed, 
   just as you would when doing things the "old-fashioned" way.

Do any window managers do this already? (I've seen the 
"incorrect" behavior with some versions of Fvwm, 
Enlightenment, and Sawmill, so it is pretty common.)

Hope this is useful,
                                        Owen



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