diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c index 448d223dc..9f6c264d9 100644 --- a/src/wayland/meta-wayland-pointer.c +++ b/src/wayland/meta-wayland-pointer.c @@ -281,12 +281,25 @@ static void repick_for_event (MetaWaylandPointer *pointer, const ClutterEvent *for_event) { - ClutterActor *actor; + ClutterActor *actor = NULL; if (for_event) - actor = clutter_event_get_source (for_event); + { + actor = clutter_event_get_source (for_event); + } else - actor = clutter_input_device_get_pointer_actor (pointer->device); + { + ClutterStage *stage = clutter_input_device_get_pointer_stage (pointer->device); + + if (stage) + { + ClutterPoint pos; + + clutter_input_device_get_coords (pointer->device, NULL, &pos); + actor = clutter_stage_get_actor_at_pos (stage, CLUTTER_PICK_REACTIVE, + pos.x, pos.y); + } + } if (META_IS_SURFACE_ACTOR_WAYLAND (actor)) pointer->current = meta_surface_actor_wayland_get_surface (META_SURFACE_ACTOR_WAYLAND (actor));