diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2020-05-27 11:03:26 +0200 |
---|---|---|
committer | Georges Basile Stavracas Neto <georges.stavracas@gmail.com> | 2020-06-17 13:47:38 +0000 |
commit | 79050004b06bfec2281e4129b07784404e976a20 (patch) | |
tree | 3620c5d5e846348c25c30890f474e5b02bc8d056 /src/wayland | |
parent | e5ea8f54836ed2d041f0caa420ee1bcee0ff146a (diff) | |
download | mutter-79050004b06bfec2281e4129b07784404e976a20.tar.gz |
wayland: Avoid popup grab focus changes if there's an implicit grab
Event delivery with grabbing popups stay essentially the same within
the grabbing client, we still must honor the implicit grab as long as
there is one.
This is however not the case, the popup_grab_focus() function ignores
the button state. The popup_grab_button() function will already indirectly
re-sync the focus surface after the last button is released, so checking
for button state in popup_grab_focus() is sufficient to make the implicit
grab honored with popup grabs involved.
Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1275
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1270
Diffstat (limited to 'src/wayland')
-rw-r--r-- | src/wayland/meta-wayland-popup.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/wayland/meta-wayland-popup.c b/src/wayland/meta-wayland-popup.c index f628ef04c..a4788615b 100644 --- a/src/wayland/meta-wayland-popup.c +++ b/src/wayland/meta-wayland-popup.c @@ -102,6 +102,7 @@ popup_grab_focus (MetaWaylandPointerGrab *grab, { MetaWaylandPopupGrab *popup_grab = (MetaWaylandPopupGrab*)grab; MetaWaylandSeat *seat = meta_wayland_pointer_get_seat (grab->pointer); + MetaWaylandPointer *pointer = grab->pointer; /* * We rely on having a pointer grab even when the seat doesn't have @@ -112,6 +113,9 @@ popup_grab_focus (MetaWaylandPointerGrab *grab, if (!meta_wayland_seat_has_pointer (seat)) return; + if (pointer->button_count > 0) + return; + /* Popup grabs are in owner-events mode (ie, events for the same client are reported as normal) */ if (surface && |