[clutter] scroll-actor: Fix ->transition not being reset



commit 26c1d89d1975f382d4ed4e4d7959835fee991e5e
Author: Bastien Nocera <hadess hadess net>
Date:   Fri May 18 17:34:18 2012 +0100

    scroll-actor: Fix ->transition not being reset
    
    When the transition was removed from the scroll-actor manually,
    to cancel a not-finished animation, the transition struct member
    wasn't reset to NULL.
    
    This fixes this problem, and removes the need for the struct member
    to be reset manually when animation has completed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=676334

 clutter/clutter-scroll-actor.c |   11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)
---
diff --git a/clutter/clutter-scroll-actor.c b/clutter/clutter-scroll-actor.c
index 6e534a0..5a6662c 100644
--- a/clutter/clutter-scroll-actor.c
+++ b/clutter/clutter-scroll-actor.c
@@ -397,13 +397,6 @@ clutter_scroll_actor_get_scroll_mode (ClutterScrollActor *actor)
   return actor->priv->scroll_mode;
 }
 
-static void
-on_transition_completed (ClutterTimeline *timeline,
-                         ClutterScrollActor *actor)
-{
-  actor->priv->transition = NULL;
-}
-
 /**
  * clutter_scroll_actor_scroll_to_point:
  * @actor: a #ClutterScrollActor
@@ -466,9 +459,7 @@ clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
       clutter_timeline_set_delay (CLUTTER_TIMELINE (priv->transition),
                                   info->cur_state->easing_delay);
       /* we need this to clear the priv->transition pointer */
-      g_signal_connect (priv->transition, "completed",
-                        G_CALLBACK (on_transition_completed),
-                        actor);
+      g_object_add_weak_pointer (G_OBJECT (priv->transition), (gpointer *) &priv->transition);
 
       clutter_actor_add_transition (CLUTTER_ACTOR (actor),
                                     "scroll-to",



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