mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 10:00:45 -05:00
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.
This commit is contained in:
parent
7073e69b4e
commit
d0f7debfba
@ -48,6 +48,8 @@ static gboolean recenter = FALSE;
|
|||||||
static ClutterActor *main_stage = NULL;
|
static ClutterActor *main_stage = NULL;
|
||||||
static ClutterActor *easing_mode_label = NULL;
|
static ClutterActor *easing_mode_label = NULL;
|
||||||
|
|
||||||
|
static ClutterAnimation *last_animation = NULL;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_animation_completed (ClutterAnimation *animation,
|
on_animation_completed (ClutterAnimation *animation,
|
||||||
ClutterActor *rectangle)
|
ClutterActor *rectangle)
|
||||||
@ -113,10 +115,12 @@ on_button_press (ClutterActor *actor,
|
|||||||
"y", event->y,
|
"y", event->y,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if (recenter)
|
if (recenter && last_animation != animation)
|
||||||
g_signal_connect_after (animation, "completed",
|
g_signal_connect_after (animation, "completed",
|
||||||
G_CALLBACK (on_animation_completed),
|
G_CALLBACK (on_animation_completed),
|
||||||
rectangle);
|
rectangle);
|
||||||
|
|
||||||
|
last_animation = animation;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
Loading…
Reference in New Issue
Block a user