summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2015-12-15 01:07:03 +0100
committerBenjamin Otte <otte@redhat.com>2015-12-15 01:15:51 +0100
commitf6606c4f6f7fc1b078978caf7e35cf1c8e69e6e7 (patch)
tree554f759521660bd79d44367fd904f692e5647c0d
parent220d2620e4217118ede937a4160b742391533166 (diff)
downloadgtk+-f6606c4f6f7fc1b078978caf7e35cf1c8e69e6e7.tar.gz
cssnode: Clear cache if reusing style
When we reuse styles that didn't change across changes to the source CSS, make sure we clear the caches. Otherwise child nodes will pick up styles from the old source CSS.
-rw-r--r--gtk/gtkcssnode.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gtk/gtkcssnode.c b/gtk/gtkcssnode.c
index a1bbe77d36..0772369fae 100644
--- a/gtk/gtkcssnode.c
+++ b/gtk/gtkcssnode.c
@@ -1034,6 +1034,12 @@ gtk_css_node_ensure_style (GtkCssNode *cssnode,
style_changed = gtk_css_node_set_style (cssnode, new_style);
g_object_unref (new_style);
+
+ if (!style_changed && (cssnode->pending_changes & GTK_CSS_CHANGE_SOURCE))
+ {
+ /* clear the global cache if we reuse the same style after the CSS changed */
+ g_object_set_qdata (G_OBJECT (cssnode->style), quark_global_cache, NULL);
+ }
}
else
{