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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2311>
This commit is contained in:
Carlos Garnacho 2022-02-25 13:02:26 +01:00 committed by Marge Bot
parent 8f91d831ee
commit fd0e7ed2f3

View File

@ -291,6 +291,7 @@ clutter_click_action_handle_event (ClutterAction *action,
clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (action)); clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (action));
gboolean has_button = TRUE; gboolean has_button = TRUE;
ClutterModifierType modifier_state; ClutterModifierType modifier_state;
ClutterActor *target;
if (!clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (action))) if (!clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (action)))
return CLUTTER_EVENT_PROPAGATE; return CLUTTER_EVENT_PROPAGATE;
@ -311,7 +312,11 @@ clutter_click_action_handle_event (ClutterAction *action,
if (priv->is_held) if (priv->is_held)
return CLUTTER_EVENT_STOP; 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; return CLUTTER_EVENT_PROPAGATE;
priv->press_button = has_button ? clutter_event_get_button (event) : 0; 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); 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; return CLUTTER_EVENT_PROPAGATE;
/* exclude any button-mask so that we can compare /* exclude any button-mask so that we can compare