diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c index 607468c29..99db5ecb8 100644 --- a/src/wayland/meta-wayland-keyboard.c +++ b/src/wayland/meta-wayland-keyboard.c @@ -231,13 +231,8 @@ keyboard_handle_focus_surface_destroy (struct wl_listener *listener, void *data) { 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_display_sync_wayland_input_focus (display); + meta_wayland_keyboard_set_focus (keyboard, NULL); } static gboolean diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c index b48e79fd9..77d0d5423 100644 --- a/src/wayland/meta-wayland-xdg-shell.c +++ b/src/wayland/meta-wayland-xdg-shell.c @@ -590,10 +590,15 @@ xdg_popup_destructor (struct wl_resource *resource) { MetaWaylandXdgPopup *xdg_popup = META_WAYLAND_XDG_POPUP (wl_resource_get_user_data (resource)); + MetaWaylandSurfaceRole *surface_role = + META_WAYLAND_SURFACE_ROLE (xdg_popup); + MetaWaylandSurface *surface = + meta_wayland_surface_role_get_surface (surface_role); dismiss_popup (xdg_popup); - xdg_popup->resource = NULL; + + meta_display_sync_wayland_input_focus (display_from_surface (surface)); } static void