mirror of
https://github.com/brl/mutter.git
synced 2024-11-23 00:20:42 -05:00
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:
parent
8f91d831ee
commit
fd0e7ed2f3
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user