summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRui Matos <tiagomatos@gmail.com>2015-10-21 17:35:36 +0200
committerRui Matos <tiagomatos@gmail.com>2016-01-05 20:42:05 +0100
commit88acfb8e6051f7fe7dadae41c9f97a430d75c401 (patch)
tree9661890092ab135470deb66ae9bdf16716c7c1d6
parent8e22dce5d73e519fa8b057e6e3860ce5512ac8fc (diff)
downloadmutter-88acfb8e6051f7fe7dadae41c9f97a430d75c401.tar.gz
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
-rw-r--r--src/core/window.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/core/window.c b/src/core/window.c
index f25d46c40..0aeed4fc4 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 ())
{