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
This commit is contained in:
Marco Trevisan (Treviño) 2019-07-03 18:11:46 +02:00
parent 040de396b2
commit 84616bef27

View File

@ -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));