From fd0e7ed2f3efe794716946ee9350193464b1e08b Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 25 Feb 2022 13:02:26 +0100 Subject: [PATCH] clutter: Move away from clutter_event_get_source() in ClutterClickAction Instead, ask the stage for the device actor, which is equivalent and ensured to be up-to-date. Part-of: --- clutter/clutter/clutter-click-action.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/clutter/clutter/clutter-click-action.c b/clutter/clutter/clutter-click-action.c index 77193096a..61ef598b5 100644 --- a/clutter/clutter/clutter-click-action.c +++ b/clutter/clutter/clutter-click-action.c @@ -291,6 +291,7 @@ clutter_click_action_handle_event (ClutterAction *action, clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (action)); gboolean has_button = TRUE; ClutterModifierType modifier_state; + ClutterActor *target; if (!clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (action))) return CLUTTER_EVENT_PROPAGATE; @@ -311,7 +312,11 @@ clutter_click_action_handle_event (ClutterAction *action, if (priv->is_held) return CLUTTER_EVENT_STOP; - if (!clutter_actor_contains (actor, clutter_event_get_source (event))) + target = clutter_stage_get_device_actor (clutter_event_get_stage (event), + clutter_event_get_device (event), + clutter_event_get_event_sequence (event)); + + if (!clutter_actor_contains (actor, target)) return CLUTTER_EVENT_PROPAGATE; priv->press_button = has_button ? clutter_event_get_button (event) : 0; @@ -368,7 +373,11 @@ clutter_click_action_handle_event (ClutterAction *action, g_clear_handle_id (&priv->long_press_id, g_source_remove); - if (!clutter_actor_contains (actor, clutter_event_get_source (event))) + target = clutter_stage_get_device_actor (clutter_event_get_stage (event), + clutter_event_get_device (event), + clutter_event_get_event_sequence (event)); + + if (!clutter_actor_contains (actor, target)) return CLUTTER_EVENT_PROPAGATE; /* exclude any button-mask so that we can compare