Subject: FVWM: Windowmaker like resize with modifier?

From: Gert Brinkmann <[email-masked]>
Date: Fri, 21 Feb 2003 22:48:00 +0100

Hello,

i have the following command in my fvwm2.5 config:

Mouse 3 W 4 resize

This works fine. When pressing the left window key and the right mouse 
button on a window, i can resize the window.

The thing that i do not like is, that i still have to move the mouse 
pointer to the edge or corner of the window. This edge/corner is then 
grapped by the mouse and i can resize the window. It would be much more 
comfortable if automatically *the* corner of the window is chosen to 
resize the window, that is *nearest* to the mouse pointer. Moving the 
mouse after the LeftWindowKey-Button3-Click will then move this corner.
(If i am not wrong, this is done by windowmaker this way.)

Is this possible in fvwm, too?

(Maybe by warping the pointer to the nearest corner and after releasing 
the key warping it back to the initial position? But i would like it 
most without mouse pointer warping.)

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: [email-masked]
Date: Mon, 24 Feb 2003 00:59:08 +0100

> Is this possible in fvwm, too?

Well, I once thought this was a good idea and wrote the code, but
people hated it and I backed it out again.  It is still in the
source files.  In the file move_resize.c, around line 3057 in the
current CVS code we have

  #if 0
    tx = orig->width / 10 - 1;
    ty = orig->height / 10 - 1;
  #else
    tx = 0;
    ty = 0;
  #endif

Change the "#if 0" to "#if 1".

This warps the pointer to the nearest border if it is withoin 10%
of the window size from the outer inner of the border.  If you want
it even more aggressive, change the "/ 10" to "/ 3".

When you try it out, please let me hear about your experience with
that feature.  If it is useful after all, I can easily make it a
"Style" option.

Bye

Dominik ^_^  ^_^

 --
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
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: Mon, 24 Feb 2003 11:08:24 +0100

Thank you for answering. I already thought, that nobody will reply.

> Well, I once thought this was a good idea and wrote the code, but

great

> people hated it and I backed it out again.  It is still in the

Yes, i think changes in the look or feel always have to be configurable. 
If people are used to one thing, it must not be changed without their 
agreement.

> Change the "#if 0" to "#if 1".

Ok, if i have time i will try this.

> it even more aggressive, change the "/ 10" to "/ 3".

If i want it to grab the nearest corner in the whole window, do i have 
to set it to "/ 2"?

> that feature.  If it is useful after all, I can easily make it a

Should it be a Style option or a parameter to the resize-function?

Thanks,

Gert

---

From: Dominik Vogt <[email-masked]>
Date: Mon, 24 Feb 2003 11:39:41 +0100

> If people are used to one thing, it must not be changed without their 

I think we disliked it because it is confusing.  Even I could not
get used to it.

> If i want it to grab the nearest corner in the whole window, do i have 

No, anything below "/ 3" does not work.  The code divides the
window into a grid:

  +-----+----------+-----+
  |tl   |    top   |   tr|
  |     |          |     |
  +-----+----------+-----+
  |     |          |     |
  |left |          |right|
  |     |          |     |
  +-----+----------+-----+
  |     |          |     |
  |bl   |  bottom  |   br|
  +-----+----------+-----+

With "/ 2" the sectors near the edges are covered by the
corenerpieces:

  +----------++----------+
  |tl        ||        tr|
  |          ||          |
  |          ||          |
  +==========++==========+
  |          ||          |
  |          ||          |
  |bl        ||        br|
  +----------++----------+

The code may even generate a division by zero.  I guess what you
want is roughly this:

 tl      t     tr
  +---+----+---+
  |__  \  /  __|
 l|  \__\/__/  |r
  |__/  /\  \__|
  |    /  \    |
  +---+----+---+
 bl      b     br

Should not be too hard to write.

> Should it be a Style option or a parameter to the resize-function?

Probably a parameter.

Bye

Dominik ^_^  ^_^

---

From: Gert Brinkmann <[email-masked]>
Date: Mon, 24 Feb 2003 15:16:58 +0100

> The code may even generate a division by zero.  I guess what you

I am not sure which version is better to handle: This one or another one 
with just the corners tl, tr, bl, br. I guess you have to try it in 
"real-life" to find this out.

> Should not be too hard to write.

Will you try? :)

>>Should it be a Style option or a parameter to the resize-function?

It's probably a matter of taste. But i think a parameter is better, 
because a window-dependend resize behaviour would be very confusing.

Ciao,

Gert

---

From: Dominik Vogt <[email-masked]>
Date: Mon, 24 Feb 2003 15:57:50 +0100

> >Should not be too hard to write.

Actually I was trying to encourage you to write it :)  I don't I
will have time for that one anytime soon.  Oh, and we are in
feature freeze too.

Bye

Dominik ^_^  ^_^

---

From: "S. Anderson" <[email-masked]>
Date: Mon, 24 Feb 2003 21:14:51 -0700

> > >Should not be too hard to write.

What do you think about a resize that works like this:

When you click "alt mouse2" and then move the mouse left, the window
grows to the left, and then if you move the mouse right without
releasing the mouse button the window grows smaller. And if your initial
mouse movement is right, the window will grow to the right, etc...

so the resize action will start immediatly upon mouse movment, without
having to touch a border first, and without warping the cursor to the
border.

do you think this would be easy to implement, or would it require some
major rewriting?

---

From: Dominik Vogt <[email-masked]>
Date: Tue, 25 Feb 2003 08:27:05 +0100

> do you think this would be easy to implement, or would it require some

Not very difficult, but we should not add another mouse specific
modifier.  That feature would be more important for use with the
keyboard.

Bye

Dominik ^_^  ^_^

---

From: Gert Brinkmann <[email-masked]>
Date: Thu, 27 Feb 2003 15:46:54 +0100

> mouse movement is right, the window will grow to the right, etc...

Hmm, i think the usage would be a little bit fiddly this way. IMHO it 
would be more simple to just click into the wanted area that lays 
nearest to the corner you want the window to resize at. With your method 
you certainly had the chance to resize the window at an edge or corner 
that is no even visible at the moment, but do you really need this?

I will install window maker again to test its resizing and see how 
exactly it behaves. AFAIR this was very intuitively.

Gert

---

From: Gert Brinkmann <[email-masked]>
Date: Thu, 27 Feb 2003 14:46:16 +0100

> will have time for that one anytime soon.  Oh, and we are in

Well, i took a look at/on/to (please teach me, what is correct?) the 
code. Well the function is way long. And it's been a long time since i 
did write a line of C-code. And at the moment i would be happy if i only 
had the time to get into fvwm and its configuration as user. So sorry, i 
do not dare trying to implement this at the moment, even if i really 
would enjoy it.

Gert