diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2023-02-09 16:17:34 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2023-02-09 16:23:36 +0100 |
commit | 228d681be8492feadbc5ba1b80807d2930d07b00 (patch) | |
tree | bc95c4f058a5de305418d98dd86b8f6ae6cc861b | |
parent | c4d8ba0f72cbc3326d0d871a9babb9a24d29095a (diff) | |
download | mutter-228d681be8492feadbc5ba1b80807d2930d07b00.tar.gz |
wayland: Trigger full focus sync after keyboard focus surface is destroyed
This used to be implicitly done by popups using a META_GRAB_OP_WAYLAND_POPUP
MetaDisplay grab. Since commit a8cd488c6f4e Wayland popups no longer do that,
so the keyboard focus was simply unset if a popup was destroyed while having
the keyboard focus.
Trigger a full input focus sync, so the correct MetaWaylandKeyboard focus
surface is looked up from the focused MetaWindow.
Fixes: a8cd488c6f4e - wayland: Drop redundant MetaDisplay grab op
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2833>
-rw-r--r-- | src/wayland/meta-wayland-keyboard.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c index 8c12ef145..65b1e5ce5 100644 --- a/src/wayland/meta-wayland-keyboard.c +++ b/src/wayland/meta-wayland-keyboard.c @@ -229,10 +229,15 @@ on_keymap_layout_group_changed (MetaBackend *backend, static void keyboard_handle_focus_surface_destroy (struct wl_listener *listener, void *data) { - MetaWaylandKeyboard *keyboard = wl_container_of (listener, keyboard, - focus_surface_listener); + MetaWaylandKeyboard *keyboard = + wl_container_of (listener, keyboard, focus_surface_listener); + MetaWaylandInputDevice *input_device = META_WAYLAND_INPUT_DEVICE (keyboard); + MetaWaylandSeat *seat = meta_wayland_input_device_get_seat (input_device); + MetaWaylandCompositor *compositor = meta_wayland_seat_get_compositor (seat); + MetaContext *context = meta_wayland_compositor_get_context (compositor); + MetaDisplay *display = meta_context_get_display (context); - meta_wayland_keyboard_set_focus (keyboard, NULL); + meta_display_sync_wayland_input_focus (display); } static gboolean |