Commit 13cbd22d authored by Benjamin Otte's avatar Benjamin Otte

stylecontext: Clear animations for values kept in cache

parent 37dac2a4
......@@ -565,3 +565,19 @@ _gtk_css_computed_values_is_static (GtkCssComputedValues *values)
return TRUE;
}
void
_gtk_css_computed_values_cancel_animations (GtkCssComputedValues *values)
{
g_return_if_fail (GTK_IS_CSS_COMPUTED_VALUES (values));
if (values->animated_values)
{
g_ptr_array_unref (values->animated_values);
values->animated_values = NULL;
}
g_slist_free_full (values->animations, g_object_unref);
values->animations = NULL;
}
......@@ -94,6 +94,7 @@ void _gtk_css_computed_values_create_animations (GtkCssCom
GtkStyleContext *context);
GtkBitmask * _gtk_css_computed_values_advance (GtkCssComputedValues *values,
gint64 timestamp);
void _gtk_css_computed_values_cancel_animations (GtkCssComputedValues *values);
gboolean _gtk_css_computed_values_is_static (GtkCssComputedValues *values);
G_END_DECLS
......
......@@ -3173,6 +3173,9 @@ _gtk_style_context_validate (GtkStyleContext *context,
change |= GTK_CSS_CHANGE_ANIMATE;
changes = _gtk_css_computed_values_get_difference (data->store, current->store);
/* In the case where we keep the cache, we want unanimated values */
_gtk_css_computed_values_cancel_animations (current->store);
}
else
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment