[mutter/wip/carlosg/app-grid-gestures: 1/2] clutter: Update ClutterGestureAction point position before ::prepare




commit df91fd10cec1684978cbb7496f4a9184ba0ccb6f
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Mar 18 18:36:37 2021 +0100

    clutter: Update ClutterGestureAction point position before ::prepare
    
    We might want to perform distance/threshold checks in the ::prepare
    vfunc, but we didn't record the last motion event yet. This used to
    give a delta of 0/0 between the press and last motion coordinates,
    despite the ClutterGestureAction having a trigger threshold. This
    happens no longer.

 clutter/clutter/clutter-gesture-action.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/clutter/clutter/clutter-gesture-action.c b/clutter/clutter/clutter-gesture-action.c
index 9b5613bea5..ab69bcf37f 100644
--- a/clutter/clutter/clutter-gesture-action.c
+++ b/clutter/clutter/clutter-gesture-action.c
@@ -416,12 +416,10 @@ stage_captured_event_cb (ClutterActor         *stage,
               return CLUTTER_EVENT_PROPAGATE;
             }
 
+          gesture_update_motion_point (point, event);
+
           if (!begin_gesture (action, actor))
-            {
-              if ((point = gesture_find_point (action, event, &position)) != NULL)
-                gesture_update_motion_point (point, event);
-              return CLUTTER_EVENT_PROPAGATE;
-            }
+            return CLUTTER_EVENT_PROPAGATE;
 
           if ((point = gesture_find_point (action, event, &position)) == NULL)
             return CLUTTER_EVENT_PROPAGATE;


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