Subject: FVWM: problem with raising next window

From: Guido Berhoerster <[email-masked]>
Date: Mon, 22 Dec 2003 00:25:01 +0100

Hello,
I'm trying to emulate Mwm's f.circle_up function. It is used to
raise the window which is on the bottom of the window stack to
the top so that it won't be obscured by other windows however it
does _NOT_ set the focus to the raised window.
I have bound a the following command to a keyboard shortcut:

Key Escape A    M  Next (AcceptsFocus) Raise

Unfortunately it does not appear to work, no windows are raised.
Strange enough the following, very similar command which is used
to set the focus to the next window works perfectly:

Key Tab    A    M  Next (AcceptsFocus) Focus

What am I missing here and how can I get it to work?
-- 
Guido Berhoerster    [email-masked]
                     http://www.guido-berhoerster.org/
--
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: Mikhael Goikhman <[email-masked]>
Date: Sun, 21 Dec 2003 23:54:58 +0000

> What am I missing here and how can I get it to work?

Next window is the one after the focused one in the window list.
So, if you don't change Focus, only Raise the next window, the
consecutive Next commands will operate on the same window.

You almost always want to do Focus with Next, so create a function that
does Raise _and_ Focus and other things like uniconify, WarpToWindow
if you want this. You may reuse the WindowListFunc for example.
In one of the latest stable or latest unstable versions do:

  Key Escape A    M  Next (AcceptsFocus) WindowListFunc

(In the older versions the WindowListFunc syntax would be less compact.)

Regards,
Mikhael.

---

From: Guido Berhoerster <[email-masked]>
Date: Mon, 22 Dec 2003 09:52:45 +0100

> consecutive Next commands will operate on the same window.

OK, now I see the problem, thanks for the hint.

> (In the older versions the WindowListFunc syntax would be less compact.)

Well, actually this is not what I intended to do, I find Mwm's
f.circle_up very convenient because it lets you cycle through all
windows whithout setting the focus to them. Is there any way how I
can go through the window list and raise window after window
whithout setting focus to them?
-- 
Guido Berhoerster    [email-masked]
                     http://www.guido-berhoerster.org/
--
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: Mikhael Goikhman <[email-masked]>
Date: Mon, 22 Dec 2003 16:55:34 +0000

> whithout setting focus to them?

Please do not assume that anyone knows what other window managers do
(especially non-existent anymore). You should explain in full details how
you see this binding working. There are a lot of issues like whether to
circulate-raise-only on the current page, current desk or all desks.
Whether to warp to window on not. What to do in the situation if there is
a window that is currently under the focussed window and fully covers it.
If we raise it, should the fully non-visible window remain focused or not?

Ok, here is a solution that may work for you (I think it works in 2.5.x
only; in older versions, Next always starts from Current regardless of
the window context):

  DestroyFunc CirculateRaiseWindows
  AddToFunc   CirculateRaiseWindows
  + I WindowId $[LAST_RAISED_WID] Next (!Iconic) SetEnv LAST_RAISED_WID $$$$$$$$[w.id]
  + I WindowId $[LAST_RAISED_WID] Raise

  # Press Shift-Alt-Escape to reset this circulate-raise
  Key Escape A  SM  Current SetEnv LAST_RAISED_WID $$$$[w.id]

  # Press Alt-Escape to circulate-raise
  Key Escape A  M   CirculateRaiseWindows

But this only works well with ClickToFocus policy, or if here is only one
window under your pointer, otherwise Raise may result in Focus and this
changes the circulate window list, so you may press much more Alt-Escape
keys in this case to return to the starting window.

And, finally, if you want just to see all windows at once, even currently
lowered under other windows, then you probably want WindowList (the
default Alt-Tab binding) or FvwmProxy module instead.

Regards,
Mikhael.