cssnode: Set new style if it's animated

In commit 2c61316677 we avoided emitting
the style-changed signal if no CSS property changed.

Unfortunately, this also caused CSS styles to not be updated when
animations started if those animations did not change any CSS value
immediately. In those cases the animation would just never start.
The obvious example was the spinner.
This commit is contained in:
Benjamin Otte 2015-12-13 16:02:34 +01:00
parent b22a07ec66
commit eb97ef0514

View File

@ -959,7 +959,16 @@ gtk_css_node_set_style (GtkCssNode *cssnode,
style_changed = gtk_css_style_change_has_change (&change);
if (style_changed)
g_signal_emit (cssnode, cssnode_signals[STYLE_CHANGED], 0, &change);
{
g_signal_emit (cssnode, cssnode_signals[STYLE_CHANGED], 0, &change);
}
else if (cssnode->style != style &&
(GTK_IS_CSS_ANIMATED_STYLE (cssnode->style) || GTK_IS_CSS_ANIMATED_STYLE (style)))
{
/* This is when animations are starting/stopping but they didn't change any CSS this frame */
g_object_unref (cssnode->style);
cssnode->style = g_object_ref (style);
}
gtk_css_style_change_finish (&change);