From bfc1583d76548f9882a4d77df39d32733883814d Mon Sep 17 00:00:00 2001 From: Chris Lord Date: Fri, 22 Oct 2010 16:32:05 +0100 Subject: [PATCH] state: Fix warping to the current state during transitions If you warp to a state, it should be immediately set. Check if the animation is in progress when warping to a state and don't short-circuit in the already-set check if we're not animating. --- clutter/clutter-state.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/clutter/clutter-state.c b/clutter/clutter-state.c index c87f66cca..bb355daa0 100644 --- a/clutter/clutter-state.c +++ b/clutter/clutter-state.c @@ -507,8 +507,12 @@ clutter_state_change (ClutterState *state, if (target_state_name == priv->target_state_name) { - /* Avoid transitioning if the desired state is already current */ - return priv->timeline; + /* Avoid transitioning if the desired state is already current, + * unless we're warping to it and the state transition is in + * progress (in that case, immediately warp to the state). + */ + if (!clutter_timeline_is_playing (priv->timeline) || animate) + return priv->timeline; } if (priv->current_animator != NULL)