diff options
author | Benjamin Otte <otte@redhat.com> | 2015-12-13 16:02:34 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2015-12-13 16:12:39 +0100 |
commit | eb97ef05146debfb37821e93d33e4375a6f9d1ed (patch) | |
tree | 4e38dda41a1b1b1a75ece230e5c6b4ac437ee757 /gtk | |
parent | b22a07ec6670946a29ae2617b8b959809bc151ca (diff) | |
download | gtk+-eb97ef05146debfb37821e93d33e4375a6f9d1ed.tar.gz |
cssnode: Set new style if it's animated
In commit 2c613166771ea9118ebda91c311f11b3462330fb 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.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkcssnode.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gtk/gtkcssnode.c b/gtk/gtkcssnode.c index ec89634eb3..a1bbe77d36 100644 --- a/gtk/gtkcssnode.c +++ b/gtk/gtkcssnode.c @@ -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); |