From 0eb9c439081b3f577c099154b428737a76e679a1 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Thu, 8 Feb 2024 10:03:04 +0100 Subject: [PATCH] wayland: Trigger seat focus change on popup changes Popups were missing the "input focus" unification in the pointer seat, triggering MetaWaylandKeyboard focus changes underneath. On one hand this missed moving all associated focus with it, on the other hand this made keyboard and global input focus get out of sync, and bring funky behavior like keyboard focus loss after dismissing popups. Fixes: 7b232d9f65 ("wayland: Keep track of the "input focus" on MetaWaylandSeat") Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3256 Part-of: --- src/wayland/meta-wayland-popup.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/wayland/meta-wayland-popup.c b/src/wayland/meta-wayland-popup.c index f757767c4..3777e9c4d 100644 --- a/src/wayland/meta-wayland-popup.c +++ b/src/wayland/meta-wayland-popup.c @@ -251,9 +251,7 @@ meta_wayland_popup_dismiss (MetaWaylandPopup *popup) top_popup_surface = meta_wayland_popup_grab_get_top_popup (popup_grab); seat = meta_wayland_pointer_get_seat (popup_grab->generic.pointer); - - if (meta_wayland_seat_has_keyboard (seat)) - meta_wayland_keyboard_set_focus (seat->keyboard, top_popup_surface); + meta_wayland_seat_set_input_focus (seat, top_popup_surface); } } @@ -283,8 +281,7 @@ meta_wayland_popup_create (MetaWaylandPopupSurface *popup_surface, wl_list_insert (&grab->all_popups, &popup->link); seat = meta_wayland_pointer_get_seat (grab->generic.pointer); - if (meta_wayland_seat_has_keyboard (seat)) - meta_wayland_keyboard_set_focus (seat->keyboard, surface); + meta_wayland_seat_set_input_focus (seat, surface); return popup; }