From 84616bef27fb193cff901ca2a8b1ab65b6356c0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Wed, 3 Jul 2019 18:11:46 +0200 Subject: [PATCH] window: Allow grab if the display focus is unset As per commit 040de396b, we don't try to grab when shortcuts are inhibited, However, this uses the focus window assuming that it is always set, while this might not be the case in some scenarios (like when unsetting the focus before requesting take-focus-window to acquire the input). So allow the button grab even if the focus window is not set for the display Closes: https://gitlab.gnome.org/GNOME/mutter/issues/663 https://gitlab.gnome.org/GNOME/mutter/merge_requests/668 --- src/core/window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/window.c b/src/core/window.c index 185c92534..4c0761d70 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -8342,7 +8342,7 @@ meta_window_handle_ungrabbed_event (MetaWindow *window, event_mods = clutter_event_get_state (event); unmodified = (event_mods & grab_mods) == 0; source = clutter_event_get_source_device (event); - is_window_button_grab_allowed = + is_window_button_grab_allowed = !display->focus_window || !meta_window_shortcuts_inhibited (display->focus_window, source); is_window_grab = (is_window_button_grab_allowed && ((event_mods & grab_mods) == grab_mods));