Hello!

Recently I've upgraded to fvwm 2.4.6 from don't-remember-what older version.
I noticed a change in behavior of ClickToFocus style which I didn't like.
I like a window to be raised and given a focus when I click inside a window
but not necessarily so when I click on window frame, title, etc.
For example, I'd like following settings to work properly:

AddToFunc Select-Window         "I"     Focus
+                               "I"     Raise

Mouse   1       T       N       Select-Window
Mouse   1       T       M       Focus

See, my preferences could be perfectly described by mouse bindings
if ClickToFocusRaises feature didn't get in the way. Unconditionally
raising a window after click on its decorations thus seems to
be the bad thing.  I fixed this for myself with the following patch:

--- fvwm-2.4.6/fvwm/events.c.orig       Sat Jul 20 23:46:23 2002
+++ fvwm-2.4.6/fvwm/events.c    Sat Jul 20 23:49:29 2002
@@ -1641,6 +1641,7 @@
   Bool do_regrab_buttons = False;
   Bool do_pass_click;
   Bool has_binding = False;
+  Bool clicked_to_raise = False;
 
   DBUG("HandleButtonPress","Routine Entered");
 
@@ -1709,21 +1710,17 @@
 #endif
       )
     {
-      /* We can't raise the window immediately because the action bound to the
-       * click might be "Lower" or "RaiseLower". So mark the window as
-       * scheduled to be raised after the binding is executed. Functions that
-       * modify the stacking order will reset this flag. */
-      SET_SCHEDULED_FOR_RAISE(Tmp_win, 1);
+      clicked_to_raise = True;
       do_regrab_buttons = True;
     }
 
     Context = GetContext(Tmp_win, &Event, &PressedW);
     if (!IS_ICONIFIED(Tmp_win) && Context == C_WINDOW)
     {
-      if (Tmp_win && IS_SCHEDULED_FOR_RAISE(Tmp_win))
+      if (Tmp_win && clicked_to_raise)
       {
        RaiseWindow(Tmp_win);
-       SET_SCHEDULED_FOR_RAISE(Tmp_win, 0);
+       clicked_to_raise = False;
       }
       if (do_regrab_buttons)
        focus_grab_buttons(Tmp_win, (Tmp_win == get_focus_window()));

It seems to me that with minor modification it can be applied to HEAD.
Hope this helps.

:wq
                                        With best regards, 
                                           Vladimir Savkin. 

--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [EMAIL PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]

Reply via email to