Re: FVWM: accessing all windows with keys

From: Dominik Vogt <dominik.vogt_at_gmx.de>
Date: Wed, 29 Dec 1999 01:03:24 +0100

On Sun, Dec 26, 1999 at 11:56:22PM +0100, Dominik Vogt wrote:
> On Thu, Dec 23, 1999 at 09:55:30AM +0000, Werner LEMBERG wrote:
> > > > 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
> > > >
> > >
> > > If this is working for some but not all of your windows, it may
> > > pay to look up "lenience" in the man page.
> > >
> > > >
> > > > Werner
> >
> > 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'.

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).

> 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.
>
> > 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.
>
> 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 ^_^

--
Dominik Vogt, dominik.vogt_at_gmx.de
Reply-To: dominik.vogt_at_gmx.de
--
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 majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Tue Dec 28 1999 - 18:14:48 GMT

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:38:02 BST