Re: FVWM: vi movement on windows

From: Dominik Vogt <dominik.vogt_at_gmx.de>
Date: Wed, 27 Jun 2001 01:25:50 +0200

On Tue, Jun 26, 2001 at 11:59:39AM -0400, Keith Kaple wrote:
> Thanks, this is closest to what I am looking for, but I guess
> it will take some work. For example if I cascade 5 xterms in
> the upper right hand corner:
>
> |___1_
> |___2_
> |___3_
> |___4_
> |___5_
>
> I expect repeating j or k to move 12345 and 54321 respectively,
> they don't...

Ah, yes. Cascaded windows are usually not really in a
North-South relationship. The code divides the area around a
window into four sectors:

  \ N /
   \ /
    \ /
  W o E
    / \
   / \
  / S \

Any window with its center in the South sector will be preferred
to any window in the E or W sector with its center lower than the
current window. Cascading to the bottom right is just along the
border between S and E or even already in E. Using S here does
not give predicatable results if your window are wider than they
are tall and E fails if they are taller. Both fail if you have
tall and wide windows. In your case, the best solution is to use
the diagonal directions SouthEast, NorthWest, ...

  NW | NE
      |
      |
  ----o----
      |
      |
  SW | SE

> actually they go 1345 and 521, like it wants to work, but
> something else is "attracting" the focus to the wrong window...
>
> I added !iconic and currentdesk, it seemed to change behavior to
> be a little better, but still not pure "closest window center"
> selection.

The selection is base on the angle between the direction from
the window center and the lines between both window centers:

  +-----+
  | o |
  +-----+
     
       +-+
    +-+|2|
    |1|+-+
    +-+

Let's assume "o" has the focus. The window centers of "1" and "2"
have exactly the same distance from "o", but since "1" deviates
0 degrees from the South direction while "2" deviates about 37
degrees. So, "1" is chosen, not "2" - even if "2" were a bit
closer.

> Tried FlipFocus too, is there anyway to alter the "complex
> formula"?

Only by changing the code in the DirectionFunc() in builtins.c.
(Or CMD_Direction() in conditionals.c for 2.3.x). We are aware
that this formula will never suit every need, but making it
configurable seemed overkill.

> Or at least fake it out ;+)
>
> Version 2.2.2


> On Tue, Jun 26, 2001 at 04:22:25PM +0200, Dominik Vogt wrote:
> > On Tue, Jun 26, 2001 at 10:04:37AM -0400, Keith Kaple wrote:
> > > I'd like to config for <control> <j|k|l|h> to move between the current desktop windows in a vi fashion based on the geometrical location of upper left corner.
> > >
> > > Does anyone have a config for this?
> >
> > The "Direction" command may do what you want:
> >
> > key j a c Direction South (currentpage) Focus
> > key k a c Direction North (currentpage) Focus
> > key h a c Direction West (currentpage) Focus
> > key l a c Direction East (currentpage) Focus
> >
> > Window selection is not based on the top left corner though, but a
> > complex formula that takes the corners into account as well as the
> > window centers. You need 2.2.x for the Direction command.

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 Thu Jun 28 2001 - 22:02:36 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:51 BST