Subject: Inconvinience after upgrade

From: "Vladimir B. Savkin" <[email-masked]>
Date: Sun, 21 Jul 2002 00:27:52 +0400

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-masked].
To report problems, send mail to [email-masked]

---

From: "Vladimir B. Savkin" <[email-masked]>
Date: Mon, 22 Jul 2002 01:06:16 +0400

On Sun, Jul 21, 2002 at 11:01:58PM +0200, Dominik Vogt wrote:
> On Sun, Jul 21, 2002 at 12:27:52AM +0400, Vladimir B. Savkin wrote:
> > Hello!
> > 
> You don't need to patch the sources for this, the functionality is
> already there:
> 
>   Style * ClickToFocusRaisesOff
>   Mouse 1 T N Raise

Then "Mouse       1       T       M       Focus" will not work as expected.
Let me restate, I want to customize window rasing on per-binding basis.

:wq
                                        With best regards, 
                                           Vladimir Savkin.

---

From: Dominik Vogt <[email-masked]>
Date: Sun, 21 Jul 2002 23:01:58 +0200

Bye

Dominik ^_^  ^_^

 --
Dominik Vogt, [email-masked]
Reply-To: [email-masked]

---

From: "Vladimir B. Savkin" <[email-masked]>
Date: Mon, 22 Jul 2002 18:00:30 +0400

> Let me restate, I want to customize window rasing on per-binding basis.

Sorry, this obviously will work. I meant to say that with settings above,
clicking inside a window will not raise it. 

:wq
                                        With best regards, 
                                           Vladimir Savkin.

---

From: Dominik Vogt <[email-masked]>
Date: Mon, 22 Jul 2002 16:30:33 +0200

> clicking inside a window will not raise it. 

Yes.  Although I can't think of any fvwm-2.x release that provided
the functionality you want, I'm thinking about how to do this.
Maybe two new focus policies would do: ManualFocus (never focus a
window except when the user sets focus on his own with a function)
and ClickClientWindowToFocus which works like ClickToFocus but
ignores clicks on the decorations.

Bye

Dominik ^_^  ^_^

 --
Dominik Vogt, mail: [email-masked], phone: 0721/91374-382
Schlund + Partner AG, Erbprinzenstr. 4-12, D-76133 Karlsruhe
--
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-masked].
To report problems, send mail to [email-masked]

---

From: "Vladimir B. Savkin" <[email-masked]>
Date: Mon, 22 Jul 2002 18:32:54 +0400

> and ClickClientWindowToFocus which works like ClickToFocus but
      ^^^^^^^^^^^^^^^^^^^^^^^^

That would be great. And before it's implemented I will use my patch. :)

:wq
                                        With best regards, 
                                           Vladimir Savkin.