Subject: FVWM: Proposed patch (Was: Function for toggling between windows?)

From: Markus Gutschke <[email-masked]>
Date: Fri, 7 Mar 1997 15:09:52 +0100

[ This is part of a private e-mail exchange between Wolf and me. I
  figured, the list might be interested in this as well.
  Wolf, I hope you do not mind that I quote your message, here. If you
  do, then please flame me in e-mail :-) ]

Christopher Wolf writes:
 > The mouse-focus routines do not update the windowlist the way the
 > click-focus routines do, i.e. move the last clicked window to the
 > front.  The mouse-focus seems to only put new windows in the front.
 > The FlipFocus is different from focus in that instead of moving it to
 > the front of the windowlist, it flips the position of the stated
 > window with that in the leading position, hence the need for
 > Prev-Flipfocus. *Supposedly*, changing mouse-focus to move windows
 > like click-focus would bog down the interface, especially as one
 > moved around the screen.  I can believe this, but it seems like
 > alowances could be made, like a minimum transient time, or just always
 > keeping track of the last two windows in a separate structure, and
 > not actually reordering the windowlist per se.
 > 
 > I'd *love* to use this function, but it never works correctly, and
 > no-one seems to be willing into looking into changes.

I whipped up a really simple patch that might improve the behavior of
"FlipFocus" when used in mouse-focus mode. I have done *very* little
testing and it is quite possible that this patch breaks some other
functionality. First impressions suggest, that the new behavior is
more correct than the old one. As I do not fully understand FVWM's
internal handling of window lists, I would very much appreciate if
somebody else took a close look at this fix and checks that it takes
the right approach.

Markus

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

---

From: [email-masked] (Nadim Saeed)
Date: Thu, 20 Mar 1997 13:42:02 -0800 (PST)

> +++ events.c    Fri Mar  7 14:47:03 1997

Markus, I've been using your patch for the past couple of weeks and it seems
solid.  I fail to see the functionality of the code above (the code that was
essentially excluded), yet I'm not too familiar with the internals of Fvwm
either.

Alas, will this patch make it in the next release (if not, could we get
something IN that will insure FlipFocus' functionality when used in
conjunction with MouseFocus) ? 

NOTE: the above patch applies to fvwm-2.0.45

 - Nadim

--
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: Christopher Wolf <[email-masked]>
Date: Fri, 21 Mar 1997 13:43:04 -0600 (CST)

>somebody else took a close look at this fix and checks that it takes

Markus,

I've been using the patch you wrote, and it seems to work well.  I
hope this effect can be incorporated somehow into the standard FVWM.

-Wolf

---

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

> essentially excluded), yet I'm not too familiar with the internals of Fvwm

The code that I excluded does not seem to fulfil any purpose. I
imagine that it is probably left over from earlier development cycles
and I decided to leave it in the comments, so that whoever wrote this
part of the code could comment on it (if neccessary).

> conjunction with MouseFocus) ? 

I have no idea what I need do to officially get my patch included into
newer versions of Fvwm. The two of you, are the only people who have
commented on my code and both of you confirm that it works for you and
does not have any undesirable side-effects, so I _think_ including it
into the official release would be a good idea.

Whom do I need to lobby? Chuck, can you hear me :-)

Markus

P.S.:  N.B. this bug-fix does _not_ fix all of the problems that are
       related to the window history when used in conjunction with
       MouseFocus, but it ensures that FlipFocus works as expected. A
       full bug-fix would be considerably more difficult (at least,
       that conclusion is suggested by a first inspection of the
       current code.)