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
This commit is contained in:
Bastien Nocera 2012-05-18 17:34:18 +01:00
parent c9028cee48
commit 26c1d89d19

View File

@ -397,13 +397,6 @@ clutter_scroll_actor_get_scroll_mode (ClutterScrollActor *actor)
return actor->priv->scroll_mode; return actor->priv->scroll_mode;
} }
static void
on_transition_completed (ClutterTimeline *timeline,
ClutterScrollActor *actor)
{
actor->priv->transition = NULL;
}
/** /**
* clutter_scroll_actor_scroll_to_point: * clutter_scroll_actor_scroll_to_point:
* @actor: a #ClutterScrollActor * @actor: a #ClutterScrollActor
@ -466,9 +459,7 @@ clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
clutter_timeline_set_delay (CLUTTER_TIMELINE (priv->transition), clutter_timeline_set_delay (CLUTTER_TIMELINE (priv->transition),
info->cur_state->easing_delay); info->cur_state->easing_delay);
/* we need this to clear the priv->transition pointer */ /* we need this to clear the priv->transition pointer */
g_signal_connect (priv->transition, "completed", g_object_add_weak_pointer (G_OBJECT (priv->transition), (gpointer *) &priv->transition);
G_CALLBACK (on_transition_completed),
actor);
clutter_actor_add_transition (CLUTTER_ACTOR (actor), clutter_actor_add_transition (CLUTTER_ACTOR (actor),
"scroll-to", "scroll-to",