> > Normally you would use the gravity of a window to determine the
> > direction in which it grows.
> 
> Each window's gravity would then need to be changed whenever its 
> position or size changes enough according to some heuristic. At least 
> there would be some hope for those poor windows that find themselves at 
> the lower half of the screen -- they would be compensated with upwards 
> mobile Northern gravity :-)
> 
> But some windows might still feel so self-important or satisfied with 
> themselves that they want to swell in place.

This is already an issue with some windows.  Most do not set a gravity
(disregarding all the broken toolkits that use StaticGravity, that is)
regardless of where they end up on the screen.  There are these stupid
Java applications that start their windows with a small size, then
calculate the contents and resize them to the final size.  Often, when
the window is placed near the right or bottom border of the screen,
resizing results in part of the window being off screen.  This has been
bugging me for a long time and eventually I'll make a patch for this,
e.g. a new stlye "PResizeKeepOnScreen" that tells fvwm to use a certain
gravity automatically when resizing the window makes it hit a screen
border.

Maybe the following would be a working approach for your script:

1) When a window is initially mapped, or resized or moved by means
   other than the script, look at the corners of the window and
   determine which corner of the screen it is closest to.  I.e. if the
   top right corner of the window is closer to the top right corner of
   the screen than the other window corners are to their respective
   screen corner, then the window will be resized to the bottom left.
   Store this information somewhere, perhaps in two window state bits.

2) When the scroll wheel is used, another script looks up the stored
   resize direction and determines what to do with the window.  Note
   that this way of resizing should not trigger (1), because that
   would cause the window to grow in a different direction when the
   "closest corner" calculation changes.

3) You could even add two bottons to the window that indicate the
   resize directions and allow changing them (at the moment you need
   two buttons because each of the two states can only be used as a
   toggle).

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt

Reply via email to