Subject: FVWM: ALT+Mouse1 comfortable resize

From: Gert Brinkmann <[email-masked]>
Date: Tue, 24 Jun 2003 10:24:33 +0200

Hello,

because one thing that I am missing in fvwm is the functionality to
resize a window by pressing ALT and clicking somewhere inside the window
(e.g. KDE, windowmaker, icewm do have this feature) I am thinking about
an implementation for this:

There might be 2 possibilities to implement this feature:

1) in the source of fvwm (this seems to be very complicated if you did
not work in the fvwm-source yet)

2) by using a configuration function in .fvwmrc. Something like this:

AddToFunc MyResize
# Find the nearest edge or corner of the current window
# warp the mouse to this edge or corner
# resize
# when finished, warp back the mouse cursor to the inital position
(maybe moved by the delta-value that you have moved the mouse while
resizing)

Is this possible? (I am using the CVS version of fvwm currently). Does
somebody have an idea how to implement this, e.g. how to store the
initial mouse coordinates? At the moment I could only implement point 3
of the pseudo code: "resize" ;)

Thanks,

Gert

--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Gert Brinkmann <[email-masked]>
Date: Thu, 26 Jun 2003 18:41:41 +0200

Hi,

me, myself and I wrote:

> Is this possible? 

Does nobody know? Or did I write to complicated and misunderstanding? Or 
is nobody interested?

I could try to rewrite my question in a hopefully more understandable way.

I do not want to try implementing it if it is obviously impossible.

Thanks,

Gert

---

From: Mikhael Goikhman <[email-masked]>
Date: Sat, 28 Jun 2003 13:40:25 +0000

> not work in the fvwm-source yet)

It is not very complicated, you should just divide a window to 9 parts
(actually 8) somehow and warp the pointer to the nearer border. But there
may be some unexpected issues.

If you do this, you may add an option to all Resize commands, like
WarpToBorder, that is respected in interactive resizes.

> of the pseudo code: "resize" ;)

Theoretically it is possible. You have all information like $[w.x]
and $[w.width] to pass to your script that evaluates a new pointer
position. You may even restore the original $[pointer.x] position.

The only problem is that CursorMove does not understand absolute
coordinates for now. I think it is in my todo list (somewhere in the
very bottom). But if you use an external script anyway, you may evaluate
relative coordinates as well (relative to $[pointer.x]) for CursorMove.

Regards,
Mikhael.

---

From: Gert Brinkmann <[email-masked]>
Date: Mon, 30 Jun 2003 14:20:27 +0200

> may be some unexpected issues.

If implementation of this function is done internally it should work 
without warping the mouse pointer. You would do a remote border resize. 
(RemoteBorderSize or better NearestBorderResize)

> WarpToBorder, that is respected in interactive resizes.

Is this required? Isn't the resize function normally envoked on the 
border anyway?

> position. You may even restore the original $[pointer.x] position.

Do I call such a remote script via FvwmEvents or Exec or somehow else?

> coordinates for now. I think it is in my todo list (somewhere in the

as you write I do not think that this is a problem. I will know the 
start- and endposition of the mouse cursor.

> relative coordinates as well (relative to $[pointer.x]) for CursorMove.

Thank you,

Gert

---

From: Mikhael Goikhman <[email-masked]>
Date: Mon, 30 Jun 2003 13:12:21 +0000

> (RemoteBorderSize or better NearestBorderResize)

Ok, so don't warp to the border if this is not desired. :)

> Is this required? Isn't the resize function normally envoked on the 

If you mean the new option, yes, it is required. Resize may be initiated
from anywhere and the current behaviour should be the default. Try:

  Next (XTerm) Resize

  Key F8 A M Resize

  Mouse 1 W M Resize

> Do I call such a remote script via FvwmEvents or Exec or somehow else?

Using PipeRead if you want the script to build the correct CursorMove
command.

Regards,
Mikhael.