[clutter/clutter-1.18] gesture-action: Prepare for clutter_gesture_action_cancel() within ::gesture-end



commit ef0d2d3ddafd6e066f079c5381b586d16db97ee0
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Jul 8 18:20:26 2014 +0200

    gesture-action: Prepare for clutter_gesture_action_cancel() within ::gesture-end
    
    There may be odd situations where full gesture cancellation may be wanted at once
    when the first touch is lifted and ::gesture-end is emitted on a gesture action.
    Although calling clutter_gesture_action_cancel() within the ::gesture-end handler
    causes 2 critical warnings that are otherwise harmless.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=732907
    (cherry picked from commit 8d669ab8ceb9ad1cfb03e69d32e30033070961a6)
    Signed-off-by: Emmanuele Bassi <ebassi gnome org>

 clutter/clutter-gesture-action.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/clutter/clutter-gesture-action.c b/clutter/clutter-gesture-action.c
index f4e8418..da415d5 100644
--- a/clutter/clutter-gesture-action.c
+++ b/clutter/clutter-gesture-action.c
@@ -224,6 +224,9 @@ gesture_unregister_point (ClutterGestureAction *action, gint position)
 {
   ClutterGestureActionPrivate *priv = action->priv;
 
+  if (action->priv->points->len == 0)
+    return;
+
   g_array_remove_index (priv->points, position);
 }
 
@@ -480,7 +483,7 @@ stage_captured_event_cb (ClutterActor         *stage,
       break;
     }
 
-  if (priv->points->len == 0)
+  if (priv->points->len == 0 && priv->stage_capture_id)
     {
       g_signal_handler_disconnect (priv->stage, priv->stage_capture_id);
       priv->stage_capture_id = 0;


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