diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c index 336cea023..9e423a4e6 100644 --- a/src/wayland/meta-wayland-pointer.c +++ b/src/wayland/meta-wayland-pointer.c @@ -583,3 +583,16 @@ meta_wayland_pointer_get_relative_coordinates (MetaWaylandPointer *pointer, *sx = wl_fixed_from_double (xf); *sy = wl_fixed_from_double (yf); } + +void +meta_wayland_pointer_update_current_focus (MetaWaylandPointer *pointer, + MetaWaylandSurface *surface) +{ + pointer->current = surface; + if (surface != pointer->focus_surface) + { + const MetaWaylandPointerGrabInterface *interface = + pointer->grab->interface; + interface->focus (pointer->grab, surface); + } +} diff --git a/src/wayland/meta-wayland-pointer.h b/src/wayland/meta-wayland-pointer.h index 5eb6756e9..d5e303838 100644 --- a/src/wayland/meta-wayland-pointer.h +++ b/src/wayland/meta-wayland-pointer.h @@ -94,4 +94,8 @@ meta_wayland_pointer_get_relative_coordinates (MetaWaylandPointer *pointer, wl_fixed_t *x, wl_fixed_t *y); +void +meta_wayland_pointer_update_current_focus (MetaWaylandPointer *pointer, + MetaWaylandSurface *surface); + #endif /* __META_WAYLAND_POINTER_H__ */ diff --git a/src/wayland/meta-wayland-seat.c b/src/wayland/meta-wayland-seat.c index 85c244b30..4b08e4ac3 100644 --- a/src/wayland/meta-wayland-seat.c +++ b/src/wayland/meta-wayland-seat.c @@ -434,6 +434,13 @@ meta_wayland_seat_repick (MetaWaylandSeat *seat, ClutterActor *actor = NULL; MetaWaylandPointer *pointer = &seat->pointer; MetaWaylandSurface *surface = NULL; + MetaDisplay *display = meta_get_display (); + + if (display->grab_op != META_GRAB_OP_NONE) + { + meta_wayland_pointer_update_current_focus (pointer, NULL); + return; + } if (for_event) { @@ -456,13 +463,7 @@ meta_wayland_seat_repick (MetaWaylandSeat *seat, if (META_IS_SURFACE_ACTOR_WAYLAND (actor)) surface = meta_surface_actor_wayland_get_surface (META_SURFACE_ACTOR_WAYLAND (actor)); - pointer->current = surface; - if (surface != pointer->focus_surface) - { - const MetaWaylandPointerGrabInterface *interface = - pointer->grab->interface; - interface->focus (pointer->grab, surface); - } + meta_wayland_pointer_update_current_focus (pointer, surface); } void