]> Pileus Git - ~andy/gtk/commitdiff
stylecontext: Always create animations
authorBenjamin Otte <otte@redhat.com>
Mon, 17 Sep 2012 09:34:54 +0000 (11:34 +0200)
committerBenjamin Otte <otte@redhat.com>
Mon, 17 Sep 2012 18:40:01 +0000 (20:40 +0200)
Even when there is no current values, do create animations. This ensures
that animations do exist for unmapped widgets when they get mapped
later.

gtk/gtkstylecontext.c

index b06d4d868dc4fa35cf8db5027202e122109c299a..e5d416f5be061ad5fe5035214a3ce9f1274327eb 100644 (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);
         }
 
-      if (current)
-        {
-          StyleData *data;
-
-          data = style_data_lookup (context);
+      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);
+      _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)
+        {
           changes = _gtk_css_computed_values_get_difference (data->store, current->store);
 
           /* In the case where we keep the cache, we want unanimated values */