diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c index a7b5eb045..f19e52a70 100644 --- a/src/wayland/meta-wayland-pointer.c +++ b/src/wayland/meta-wayland-pointer.c @@ -352,22 +352,6 @@ count_buttons (const ClutterEvent *event) return count; } -static void -update_current_focus (MetaWaylandPointer *pointer, - MetaWaylandSurface *surface) -{ - pointer->current = surface; - - if (pointer->cursor_tracker && surface == NULL) - meta_cursor_tracker_unset_window_cursor (pointer->cursor_tracker); - - if (surface != pointer->focus_surface) - { - const MetaWaylandPointerGrabInterface *interface = pointer->grab->interface; - interface->focus (pointer->grab, surface); - } -} - static void repick_for_event (MetaWaylandPointer *pointer, const ClutterEvent *for_event) @@ -376,12 +360,6 @@ repick_for_event (MetaWaylandPointer *pointer, MetaWaylandSurface *surface = NULL; MetaDisplay *display = meta_get_display (); - if (meta_grab_op_should_block_wayland (display->grab_op)) - { - update_current_focus (pointer, NULL); - return; - } - if (for_event) { actor = clutter_event_get_source (for_event); @@ -403,7 +381,19 @@ repick_for_event (MetaWaylandPointer *pointer, if (META_IS_SURFACE_ACTOR_WAYLAND (actor)) surface = meta_surface_actor_wayland_get_surface (META_SURFACE_ACTOR_WAYLAND (actor)); - update_current_focus (pointer, surface); + if (meta_grab_op_should_block_wayland (display->grab_op)) + surface = NULL; + + pointer->current = surface; + + if (pointer->cursor_tracker && surface == NULL) + meta_cursor_tracker_unset_window_cursor (pointer->cursor_tracker); + + if (surface != pointer->focus_surface) + { + const MetaWaylandPointerGrabInterface *interface = pointer->grab->interface; + interface->focus (pointer->grab, surface); + } } static void