style_context = GTK_STYLE_CONTEXT (object);
priv = style_context->priv;
- gtk_style_context_stop_animating (style_context);
+ _gtk_style_context_stop_animations (style_context);
/* children hold a reference to us */
g_assert (priv->children == NULL);
context->priv->widget = widget;
+ _gtk_style_context_stop_animations (context);
+
_gtk_style_context_queue_invalidate (context, GTK_CSS_CHANGE_ANY_SELF);
}
priv->invalidating_context = FALSE;
}
+void
+_gtk_style_context_stop_animations (GtkStyleContext *context)
+{
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+
+ if (!gtk_style_context_is_animating (context))
+ return;
+
+ gtk_style_context_stop_animating (context);
+}
+
void
_gtk_style_context_validate (GtkStyleContext *context,
gint64 timestamp,
if (gtk_widget_get_mapped (widget))
gtk_widget_unmap (widget);
+
+ if (widget->priv->context)
+ _gtk_style_context_stop_animations (widget->priv->context);
}
}