summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-06-29 19:33:46 -0400
committerMatthias Clasen <mclasen@redhat.com>2014-06-29 19:41:11 -0400
commit9f008e347788da4799c5c12729a94c25cb6f07fb (patch)
treef4210bb6c349f2da7791aa6485e095cee25b57e8
parent3d53e5d9c7859d2d2df5dc4b68513864b80716c2 (diff)
downloadgtk+-9f008e347788da4799c5c12729a94c25cb6f07fb.tar.gz
GtkStyleContext: Avoid over-eager animation cancellation
When validating the style context, we are copying the animations from one StyleValues instance to another, and cancel the old ones. It turns out that sometimes the old and the new StyleValues are the same, and in this case, we end up cancelling the animations for good. One case where breakage from this was observed is that the spinners in gtk3-widget-factory stop spinning when you open and close a modal dialog on page 2. This depends a bit on the window manager; the problem can only be seen if opening the dialog causes a transition to backdrop.
-rw-r--r--gtk/gtkstylecontext.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 1ca31bced9..fd804b291e 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -3058,12 +3058,13 @@ _gtk_style_context_validate (GtkStyleContext *context,
values = style_values_lookup (context);
- _gtk_css_computed_values_create_animations (values,
- priv->parent ? style_values_lookup (priv->parent) : NULL,
- timestamp,
- GTK_STYLE_PROVIDER_PRIVATE (priv->cascade),
- priv->scale,
- gtk_style_context_should_create_transitions (context) ? current : NULL);
+ if (values != current)
+ _gtk_css_computed_values_create_animations (values,
+ priv->parent ? style_values_lookup (priv->parent) : NULL,
+ timestamp,
+ GTK_STYLE_PROVIDER_PRIVATE (priv->cascade),
+ priv->scale,
+ gtk_style_context_should_create_transitions (context) ? current : NULL);
if (_gtk_css_computed_values_is_static (values))
change &= ~GTK_CSS_CHANGE_ANIMATE;
else
@@ -3075,7 +3076,8 @@ _gtk_style_context_validate (GtkStyleContext *context,
changes = _gtk_css_computed_values_get_difference (values, current);
/* In the case where we keep the cache, we want unanimated values */
- _gtk_css_computed_values_cancel_animations (current);
+ if (values != current)
+ _gtk_css_computed_values_cancel_animations (current);
}
else
{