Subject: FVWM: MS Windows-like window switching

From: Mike Frisch <[email-masked]>
Date: Tue, 25 Mar 1997 13:29:47 -0500 (EST)

One of the things I've found to be missing from any X window manager I've
tried is the MS Windows way of window focus switching.  For those of you
who are not familiar, I will explain: 

Windows "A B C D E" are open (not necessarily visible)

Window "A" is in focus

User switches from Window "A" to Window "B"

Window list looks like "B A C D E"

User switches from Window "B" to Window "E"

Window list "E B A C D"

The point is that the previously used window becomes the second item in
the window list.  This makes it very convenient to switch between two
windows without having to cycle through all of them (which seems to be
the case in all window managers I've used).

I am curious if anybody has implemented this in fvwm2 and if not, could
somebody direct me to the place in the code where I could find the
handling of the keyboard window focus changing?  I'd like to take a stab
at this myself if it's not too difficult.

Thanks.

Mike.

======================================================================
Mike Frisch                             Email: [email-masked]
Northstar Technologies      WWW: http://mfrisch.rogerswave.ca/~mfrisch
Newmarket, Ontario, Canada

--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
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 Niles <[email-masked]>
Date: Tue, 25 Mar 1997 16:51:27 -0600

> who are not familiar, I will explain: 

[clip]

> the case in all window managers I've used).

If you use ClickToFocus you get this behavior.  ClickToFocus is also the
way focus in done in MS Windows.  To use ClickToFocus add the style line:

Style "*"           ClickToFocus

To have a key that works like Alt+Tab, create a binding like:

Key F8          A       N       Prev [] FlipFocus

The feature that is distinctly missing is the MS Windows behavior when
you hit and hold Alt, hit Tab multiple times, and release Alt.  Something
close can be achived with:

Key F8          A       S       Prev [] Focus

The problem with this is that it does not reorder the window list, so the
result will not always be what you expect.  If anyone has any idea how to
do this, let me know.  I would be willing to do the programming.

Hope that helps,

Dan Niles
(author of FlipFocus)

-- 
#--------------------------------#
# Dan Niles      Signatures      #
# [email-masked]   should be small #
#--------------------------------#
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
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: Kai Grossjohann <[email-masked]>
Date: 26 Mar 1997 08:19:14 +0100

>>>>> Dan Niles writes:

  Dan> The feature that is distinctly missing is the MS Windows
  Dan> behavior when you hit and hold Alt, hit Tab multiple times, and
  Dan> release Alt.  Something close can be achived with:

  Dan> Key F8          A       S       Prev [] Focus

  Dan> The problem with this is that it does not reorder the window
  Dan> list, so the result will not always be what you expect.  If
  Dan> anyone has any idea how to do this, let me know.  I would be
  Dan> willing to do the programming.

One could use the window list for that, even though it's more like
Ctrl-Esc or Alt-Esc or whatever calls the task list.  But I think
selecting a window from the window list doesn't reorder the windows,
either, does it?

kai
-- 
I wish my mouth had a backso^Hpace key.

---

From: Mike Frisch <[email-masked]>
Date: Wed, 26 Mar 1997 09:46:18 -0500 (EST)

> selecting a window from the window list doesn't reorder the windows,

Yes, I would agree that the window list more resembles the task list in
Windows.  I simply want a method of switching between open windows in a
somewhat methodical manner as I outlined in my posting.  I have been
advised of the flip-focus feature, but have yet to try it.  Apparently, it
won't do exactly what I want but close.  I think I may start coding...

Mike.

---

From: Markus Gutschke <[email-masked]>
Date: 26 Mar 1997 14:27:10 +0100

> Key F8          A       N       Prev [] FlipFocus

I seems that most people do not want to switch to ClickToFocus mode,
just in order to get a working version of FlipFocus. In current
releases of Fvwm the handling of the window history is broken, when
used in conjunction with MouseFocus. A complete and satisfying bug-fix
is rather difficult, but if all you care for is FlipFocus, then you
can use the patch that I posted a little while ago:

--- events.c.orig       Fri Mar  7 14:58:06 1997
+++ events.c    Fri Mar  7 14:47:03 1997
@@ -1117,12 +1117,16 @@

   if(!(Tmp_win->flags & ClickToFocus))
     {
+#if 0
       if(Scr.Focus != Tmp_win)
        {
          SetFocus(Tmp_win->w,Tmp_win,0);
        }
       else
        SetFocus(Tmp_win->w,Tmp_win,0);
+#else
+      SetFocus(Tmp_win->w,Tmp_win,1);
+#endif
     }
   if (Scr.ColormapFocus == COLORMAP_FOLLOWS_MOUSE)
   {

-- 
Markus Gutschke          Internet:       [email-masked]
Schlage 5a               PGP public key: finger -l [email-masked]
D-48268 Greven-Gimbte
Germany                            >>> I prefer encrypted e-mail <<<