From d0f7debfba4879c3df20c0067789b063e18d93ce Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 22 Jan 2010 21:44:28 +0000 Subject: [PATCH] test-easing: Do not reconnect signals multiple times The test should keep track of the last animation and avoid reconnecting signals to the same instance in case the -r argument has been passed. --- tests/interactive/test-easing.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/interactive/test-easing.c b/tests/interactive/test-easing.c index bc0b73ab6..396d636fb 100644 --- a/tests/interactive/test-easing.c +++ b/tests/interactive/test-easing.c @@ -48,6 +48,8 @@ static gboolean recenter = FALSE; static ClutterActor *main_stage = NULL; static ClutterActor *easing_mode_label = NULL; +static ClutterAnimation *last_animation = NULL; + static void on_animation_completed (ClutterAnimation *animation, ClutterActor *rectangle) @@ -113,10 +115,12 @@ on_button_press (ClutterActor *actor, "y", event->y, NULL); - if (recenter) + if (recenter && last_animation != animation) g_signal_connect_after (animation, "completed", G_CALLBACK (on_animation_completed), rectangle); + + last_animation = animation; } return TRUE;