[gnome-shell/wip/carlosg/no-event-source: 17/19] st: Move StButton away from clutter_event_get_source()




commit 7b7e5ac0de81582be5dcd21c0498f8b30b36a418
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Feb 25 16:11:09 2022 +0100

    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>

 src/st/st-button.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/src/st/st-button.c b/src/st/st-button.c
index 0e95bfaf09..3c6f5fddb6 100644
--- a/src/st/st-button.c
+++ b/src/st/st-button.c
@@ -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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]