st: Move StButton away from clutter_event_get_source()

Ask the stage about the device actor instead.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2216>
This commit is contained in:
Carlos Garnacho 2022-02-25 16:11:09 +01:00 committed by Marge Bot
parent 6d895bf8a9
commit 7b7e5ac0de

View File

@ -219,9 +219,14 @@ st_button_button_release (ClutterActor *actor,
if (priv->button_mask & mask)
{
ClutterStage *stage;
ClutterActor *target;
gboolean is_click;
is_click = priv->grabbed && clutter_actor_contains (actor, event->source);
stage = clutter_event_get_stage ((ClutterEvent *) event);
target = clutter_stage_get_event_actor (stage, (ClutterEvent *) event);
is_click = priv->grabbed && clutter_actor_contains (actor, target);
st_button_release (button, device, mask, is_click ? event->button : 0, NULL);
priv->grabbed &= ~mask;