Subject: FVWM: Focusing and scrolling screen to window in direction

From: [email-masked] (Ilpo Nyyssönen)
Date: Wed, 17 Dec 2003 21:00:32 +0200

First note that I have

EdgeScroll 3 3
Style * MouseFocus

and my windows are mostly side by side at the top of my virtual
desktop. This way I am able to get several window combinations visible
without moving the windows. I rarely create, move or close any
windows. For example I have a terminal that has this XEmacs on left
side of it and a Mozilla on right side of it. Now I am able to get
both the XEmacs and the terminal visible at the same time and then
just by moving the mouse to right, I can get the terminal and Mozilla
visible at the same time. And I don't need to move or iconify or
deiconify the windows. This is nice and works with fvwm, thank you.

But now I would like to have a keybinding that would focus the next
window left AND scroll the screen so that it is just visible (and the
same way to the right of course). It should not move the screen any
more than necessary, so that the window where I just were is left
visible.

Is this possible and how do I get it?

:-)

-- 
Ilpo Nyyssönen # biny # /* :-) */
--
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: Thu, 18 Dec 2003 09:53:41 +0100

> Is this possible and how do I get it?

Sure

  destroyfunc focus_and_move_to_top_left
  addtofunc focus_and_move_to_top_left
  + I echo scrolling
  + I scroll $[w.x]p 0
  + I WarpPointer 0 0
  + I focus nowarp

  key Left a CM direction w focus_and_move_to_top_left
  key Right a CM direction e focus_and_move_to_top_left

You may want to change some of the details of this function.

Ciao

Dominik ^_^  ^_^

---

From: [email-masked] (Ilpo Nyyssönen)
Date: Thu, 18 Dec 2003 18:47:10 +0200

> On Wed, Dec 17, 2003 at 09:00:32PM +0200, Ilpo Nyyssönen wrote:

[...]

> You may want to change some of the details of this function.

To left that mostly does it, but to the right it doesn't. That always
puts the window in the given direction to the left of the visible
area, but when going to right, it should put it to the right. It
should always scroll as little as possible but still make the window
visible.

Is it possible to scroll only when the given window is not totally in
the visible area?

Also the WarpPointer doesn't seem to do anything.

I have fvwm 2.5.8 currently.

---

From: Dominik Vogt <[email-masked]>
Date: Fri, 19 Dec 2003 10:27:24 +0100

> should always scroll as little as possible but still make the window

  destroyfunc focus_minimal_scroll
  addtofunc focus_minimal_scroll
  + I PipeRead "minimal_scroll.sh $[w.x] $[w.y] $[w.width] $[w.height] 0 0 $[vp.width] $[vp.height]"
  + I Focus nowarp
  + I WarpToWindow 0 0

  key Left a CM direction w focus_minimal_scroll
  key Right a CM direction e focus_minimal_scroll

PipeRead uses the attached shell script to do its calculations.
Put it in your $PATH and make it executable.

> Also the WarpPointer doesn't seem to do anything.

I got the command name wrong.  It's "WarpToWindow".

Ciao

Dominik ^_^  ^_^

---

From: [email-masked] (Ilpo Nyyssönen)
Date: Sun, 21 Dec 2003 11:30:24 +0200

> Put it in your $PATH and make it executable.

I improved the script a bit (and actually changed it to python) and
got it to work, thank you.

> I got the command name wrong.  It's "WarpToWindow".

That messes up the scrolling by moving the viewport. I took that and
the Focus command away and just calculated a CursorMove command from
the script.