Subject: FVWM: accessing all windows with keys

From: Werner LEMBERG <[email-masked]>
Date: Wed, 22 Dec 1999 22:54:17 GMT

Dear fvwm commmunity,

what keyboard entries in .fvwm2rc do I need to access *all* windows
with (either iconofied or open) lines like

  Key Left A 4 Direction West Focus

On my laptop, I want to use only the arrow keys for moving around, but
it happens quite often that I can't change the focus at all to a
certain window.  Some windows are apparently not in the focus window
list.

Maybe I'm doing something wrong, but I couldn't find a hint in the
docs how to do this.

    Werner

PS: Please reply to [email-masked], since I'm not on the list.
--
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: Dan Espen <[email-masked]>
Date: Wed, 22 Dec 1999 18:37:57 -0500

> Maybe I'm doing something wrong, but I couldn't find a hint in the

If this is working for some but not all of your windows, it may
pay to look up "lenience" in the man page.

--
Dan Espen
444 Hoes Lane  Room RRC 1C-214           E-mail: [email-masked]
Piscataway, NJ 08854                     Phone: (732) 699-5570
--
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: Werner LEMBERG <[email-masked]>
Date: Thu, 23 Dec 1999 09:55:30 GMT

> pay to look up "lenience" in the man page.

Indeed, this does help.  Nevertheless, the logic how the keys are
working is, hmm, strange.

Consider the following screen layout:

   oxxxxxxxo
   +-----+
   |     |
   +-----+
   .

`o' in the left edge is the pager, `o' in the right is the clock.  The
large window is xterm (with mc running in it), the `xxxxxx' is a
small, elongated window with xterm (being a bit higher than the clock
and the pager), and the dot symbolizes an iconofied xterm (with mc).

If I click on the iconofied xterm, `Direction North' brings me to the
pager instead to the xterm window.  Why?  In the man page it is
written that `closer objects are considered a better match'.

If `Lenience' is deactivated, and I click on the iconofied xterm,
`Direction North' gives nothing, but `Direction East' brings me to the
large xterm window.

I can't follow this logic :-)  Just for reference, I've attached my
.fvwm2rc file.

    Werner

---

From: Dominik Vogt <[email-masked]>
Date: Sun, 26 Dec 1999 23:56:22 +0100

> written that `closer objects are considered a better match'.

The algorithm calculating the 'best match' for the direction functions
takes the angle between the centers of the windows into account too.
Since the angle between the icon and the xterm is > 45 degrees, the
window is not considerered to be 'north' of the icon.  I agree that this
is not what one would expect.  If you like to write a better algorithm
(either as a patch for the latest CVS code or beta release or simply
in words) you are welcome to do so.  We haven't had much feedback on
this feature yet and would appreciate any cooperation to get a
more intuitive algorithm.

> `Direction North' gives nothing, but `Direction East' brings me to the

Really? I'll have to check the code why 'lenience' makes any difference.

> I can't follow this logic :-)  Just for reference, I've attached my

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: Dominik Vogt <[email-masked]>
Date: Wed, 29 Dec 1999 01:03:24 +0100

> > written that `closer objects are considered a better match'.

It was a bug, plain and simple.  If you had two windows 'North' of
your focused one, one exactly 100 pixels above it and one 500 pixels
above it, the code prefered to select the window that was 500 pixels
away.  I.e. it selected the window that was farther away.  I've fixed
that in the development code.  The fix is quite simple:

In the DirectionFunc() function you'll find a line

  score = 1024 * offset / distance + 2 * distance + 2 * offset;

Simply replace the '/' with a '*':

  score = 1024 * offset * distance + 2 * distance + 2 * offset;

and it will work.  The patch I made takes care of an integer overflow
too, but in this case the windows have to be very far away (several
pages).

> Really? I'll have to check the code why 'lenience' makes any difference.

Ah, now I understand.  But if 'lenience' helped this would imply
that you could not set focus on the window with the mouse either.

Bye

Dominik ^_^