events: Don't un-bypass Clutter event handling in presence of grabs

After an event has been handled such that it bypasses both Clutter and
Wayland, e.g. when handling a keybinding, bypass_clutter would get
unset in the presence of a wayland grab. This means that the event is
handled both as a keybinding and by Clutter.

In the case of switcher popups in gnome-shell in the presence of a gtk4
autohide popover this meant that instead of selecting the next element,
it would select the one after that. If there are only two elements, as
is common with input sources, this would mean going back to the current
one, preventing switching them with a single press of the keybinding.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6738
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3054>
This commit is contained in:
Sebastian Keller 2023-06-06 01:24:36 +02:00 committed by Carlos Garnacho
parent d1a3265988
commit 8a5067c917

View File

@ -530,7 +530,7 @@ meta_display_handle_event (MetaDisplay *display,
#ifdef HAVE_WAYLAND
/* If a Wayland client has a grab, don't pass that through to Clutter */
if (wayland_compositor && meta_wayland_compositor_is_grabbed (wayland_compositor))
bypass_clutter = !bypass_wayland;
bypass_clutter = bypass_clutter || !bypass_wayland;
if (wayland_compositor && !bypass_wayland)
{