Hi all,

I forget whom, but someone on the #fvwm IRC channel was asking about
improvements to the Resize command to behave like other window managers.  I
had a spare afternoon and have come up with the following patch series.

There's two main sets of functionality I've added to the Resize command,
namely:

* The ability to warp the pointer to the closest border to the continue to
  resize the window.

* To work out from the pointer location the direction to start the resize
  in.

The way this works is the regions that a window is divided in when drawing
the rubber band dictates the proximity of where the pointer is either warped
or resize direction set to.  So for example:

    +--------------------+
    |      |      |      |    
    |  NW  |  N   |  NE  |
    +------+------+------+
    |      |      |      |
    |  W   | N/A  |  E   |
    +------+------+------+
    |      |      |      |
    |  SW  |  S   |  SE* |
    +------+------+------+

If the pointer within the size of the window is in the region marked with an
asterisk (in this case "SE") and the following is specified:

    Resize direction automatic

Then the window would be resized in the given direction (SE).  Note that the
above example implies the further option "fixeddirection".

Likewise, if the following is specified:

    Resize warptoborder automatic

And the pointer was in the region marked with an asterisk (SE) then the
pointer is automatically warped to that corner, because it's deemed the
closest border to the region the pointer is in.

I am not as convinced on the semantics of the command -- but I did want to
make these changes optional somehow without having them implied through any
existing functionality.

So feedback, and especially testing is welcome.

These patches are intended to be applied on top of "branch-2_6" in CVS.

For those of you playing along at home, the same patches can be found here:

https://github.com/ThomasAdam/fvwm/tree/ta/resize-improvements

And for the curious, this series as emailed out, is using Git, and does
represent the sorts of changes to workflow which we'll see as and when
Dominik and I have finished with working out how Git is to be used.  I've
done this with the patch series deliberately so developers get an idea what
it's like.  Hence why I've just not blindly committed this to CVS.  :)

Kindly,

-- Thomas Adam

Thomas Adam (5):
  Introduce __resize_get_dir_from_resize_quadrant()
  Add "automatic" option to resize arguments
  __resize_dir_get_proximity() to include warp coords
  Add in support code for warping/direction
  Add Resize "automatic" docs to man page.
---
 doc/commands/Resize.xml |   21 +++--
 fvwm/move_resize.c      |  241 +++++++++++++++++++++++++++++++++++++++++-----
 2 files changed, 227 insertions(+), 35 deletions(-)

-- 
1.7.5.1

Reply via email to