[mutter] window: Focus windows on button press regardless of modifier state



commit 88acfb8e6051f7fe7dadae41c9f97a430d75c401
Author: Rui Matos <tiagomatos gmail com>
Date:   Wed Oct 21 17:35:36 2015 +0200

    window: Focus windows on button press regardless of modifier state
    
    This seems like a more generally useful and intuitive behavior. Note
    that, in X sessions, this is what already happened in practice since
    meta_display_begin_grab_op() calls meta_window_grab_all_keys() which,
    on X11, does meta_window_focus().
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756789

 src/core/window.c |   32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index f25d46c..0aeed4f 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -7707,6 +7707,22 @@ meta_window_handle_ungrabbed_event (MetaWindow         *window,
   if (window->override_redirect)
     return;
 
+  /* Don't focus panels--they must explicitly request focus.
+   * See bug 160470
+   */
+  if (window->type != META_WINDOW_DOCK)
+    {
+      meta_topic (META_DEBUG_FOCUS,
+                  "Focusing %s due to button %u press (display.c)\n",
+                  window->desc, button);
+      meta_window_focus (window, event->any.time);
+    }
+  else
+    /* However, do allow terminals to lose focus due to new
+     * window mappings after the user clicks on a panel.
+     */
+    display->allow_terminal_deactivation = TRUE;
+
   /* We have three passive button grabs:
    * - on any button, without modifiers => focuses and maybe raises the window
    * - on resize button, with modifiers => start an interactive resizing
@@ -7741,22 +7757,6 @@ meta_window_handle_ungrabbed_event (MetaWindow         *window,
       else
         meta_topic (META_DEBUG_FOCUS,
                     "Not raising window on click due to don't-raise-on-click option\n");
-
-      /* Don't focus panels--they must explicitly request focus.
-       * See bug 160470
-       */
-      if (window->type != META_WINDOW_DOCK)
-        {
-          meta_topic (META_DEBUG_FOCUS,
-                      "Focusing %s due to unmodified button %u press (display.c)\n",
-                      window->desc, button);
-          meta_window_focus (window, event->any.time);
-        }
-      else
-        /* However, do allow terminals to lose focus due to new
-         * window mappings after the user clicks on a panel.
-         */
-        display->allow_terminal_deactivation = TRUE;
     }
   else if (is_window_grab && (int) button == meta_prefs_get_mouse_button_resize ())
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]