stylecontext: Always create animations

Even when there is no current values, do create animations. This ensures
that animations do exist for unmapped widgets when they get mapped
later.
This commit is contained in:
Benjamin Otte 2012-09-17 11:34:54 +02:00
parent 4a281edc87
commit d74e1b9ac9

View File

@ -3147,6 +3147,8 @@ _gtk_style_context_validate (GtkStyleContext *context,
if (current == NULL ||
gtk_style_context_needs_full_revalidate (context, change))
{
StyleData *data;
if ((priv->relevant_changes & change) & ~GTK_STYLE_CONTEXT_CACHED_CHANGE)
{
gtk_style_context_clear_cache (context);
@ -3157,22 +3159,20 @@ _gtk_style_context_validate (GtkStyleContext *context,
style_info_set_data (info, NULL);
}
data = style_data_lookup (context);
_gtk_css_computed_values_create_animations (data->store,
timestamp,
current && gtk_style_context_should_create_transitions (context) ? current->store : NULL,
context);
if (_gtk_css_computed_values_is_static (data->store))
change &= ~GTK_CSS_CHANGE_ANIMATE;
else
change |= GTK_CSS_CHANGE_ANIMATE;
_gtk_style_context_update_animating (context);
if (current)
{
StyleData *data;
data = style_data_lookup (context);
_gtk_css_computed_values_create_animations (data->store,
timestamp,
gtk_style_context_should_create_transitions (context) ? current->store : NULL,
context);
if (_gtk_css_computed_values_is_static (data->store))
change &= ~GTK_CSS_CHANGE_ANIMATE;
else
change |= GTK_CSS_CHANGE_ANIMATE;
_gtk_style_context_update_animating (context);
changes = _gtk_css_computed_values_get_difference (data->store, current->store);
/* In the case where we keep the cache, we want unanimated values */