From 713c2952410e99e681825dac51da3e0b575ef2cf Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 23 Dec 2009 08:39:16 +0000 Subject: [PATCH] layout-manager: Rewind the timeline in begin_animation() If the default implementation begin_animation() is called twice then we should rewind the timeline, as well as updating its duration and the easing mode of the alpha. --- clutter/clutter-layout-manager.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/clutter/clutter-layout-manager.c b/clutter/clutter-layout-manager.c index 35b624f1d..77efdd96c 100644 --- a/clutter/clutter-layout-manager.c +++ b/clutter/clutter-layout-manager.c @@ -237,16 +237,20 @@ layout_manager_real_begin_animation (ClutterLayoutManager *manager, alpha = g_object_get_qdata (G_OBJECT (manager), quark_layout_alpha); if (alpha != NULL) { + clutter_alpha_set_mode (alpha, mode); + timeline = clutter_alpha_get_timeline (alpha); clutter_timeline_set_duration (timeline, duration); - - clutter_alpha_set_mode (alpha, mode); + clutter_timeline_rewind (timeline); return alpha; }; timeline = clutter_timeline_new (duration); + alpha = clutter_alpha_new_full (timeline, mode); + + /* let the alpha take ownership of the timeline */ g_object_unref (timeline); g_signal_connect_swapped (timeline, "completed",