wayland: Move away from clutter_event_get_source()

Instead ask the stage about the target actor, which is equivalent
and ensured to be up-to-date.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2311>
This commit is contained in:
Carlos Garnacho 2022-02-25 13:05:33 +01:00 committed by Marge Bot
parent 52002d042e
commit 9b6253bf3f
3 changed files with 15 additions and 5 deletions

View File

@ -641,9 +641,15 @@ repick_for_event (MetaWaylandPointer *pointer,
MetaWaylandSurface *surface;
if (clutter_event_type (for_event) == CLUTTER_LEAVE)
actor = clutter_event_get_related (for_event);
{
actor = clutter_event_get_related (for_event);
}
else
actor = clutter_event_get_source (for_event);
{
actor = clutter_stage_get_device_actor (clutter_event_get_stage (for_event),
clutter_event_get_device (for_event),
clutter_event_get_event_sequence (for_event));
}
if (META_IS_SURFACE_ACTOR_WAYLAND (actor))
{

View File

@ -585,9 +585,11 @@ static void
repick_for_event (MetaWaylandTabletTool *tool,
const ClutterEvent *for_event)
{
ClutterActor *actor = NULL;
ClutterActor *actor;
actor = clutter_event_get_source (for_event);
actor = clutter_stage_get_device_actor (clutter_event_get_stage (for_event),
clutter_event_get_device (for_event),
clutter_event_get_event_sequence (for_event));
if (META_IS_SURFACE_ACTOR_WAYLAND (actor))
tool->current = meta_surface_actor_wayland_get_surface (META_SURFACE_ACTOR_WAYLAND (actor));

View File

@ -220,7 +220,9 @@ meta_wayland_touch_update (MetaWaylandTouch *touch,
MetaWaylandSurface *surface = NULL;
ClutterActor *actor;
actor = clutter_event_get_source (event);
actor = clutter_stage_get_device_actor (clutter_event_get_stage (event),
clutter_event_get_device (event),
clutter_event_get_event_sequence (event));
if (META_IS_SURFACE_ACTOR_WAYLAND (actor))
surface = meta_surface_actor_wayland_get_surface (META_SURFACE_ACTOR_WAYLAND (actor));