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