diff options
author | Benjamin Otte <otte@redhat.com> | 2015-04-27 19:15:43 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2015-04-27 19:17:03 +0200 |
commit | 3e5280ae4dfd1950dbd56a781dcdcf34a26d4294 (patch) | |
tree | e3d28e8f0e957410020b68621ebe36eb23522281 /gtk/gtkcsswidgetnode.c | |
parent | 136a32112fc7df1eff461b3687d3626dbbbc6d33 (diff) | |
download | gtk+-3e5280ae4dfd1950dbd56a781dcdcf34a26d4294.tar.gz |
stylecontext: Clear style property more frequently
We want to clear the style property cache whenever things change in the
tree, not as we previously did only when those changes actually lead to
a different CSS style.
Diffstat (limited to 'gtk/gtkcsswidgetnode.c')
-rw-r--r-- | gtk/gtkcsswidgetnode.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gtk/gtkcsswidgetnode.c b/gtk/gtkcsswidgetnode.c index 70ae532ecd..4e67b51c3c 100644 --- a/gtk/gtkcsswidgetnode.c +++ b/gtk/gtkcsswidgetnode.c @@ -77,6 +77,24 @@ gtk_css_widget_node_queue_callback (GtkWidget *widget, return G_SOURCE_CONTINUE; } +static GtkCssStyle * +gtk_css_widget_node_update_style (GtkCssNode *cssnode, + GtkCssChange change, + gint64 timestamp, + GtkCssStyle *style) +{ + GtkCssWidgetNode *widget_node = GTK_CSS_WIDGET_NODE (cssnode); + + if (widget_node->widget != NULL) + { + GtkStyleContext *context = _gtk_widget_peek_style_context (widget_node->widget); + if (context) + gtk_style_context_clear_property_cache (context); + } + + return GTK_CSS_NODE_CLASS (gtk_css_widget_node_parent_class)->update_style (cssnode, change, timestamp, style); +} + static void gtk_css_widget_node_queue_validate (GtkCssNode *node) { @@ -249,6 +267,7 @@ gtk_css_widget_node_class_init (GtkCssWidgetNodeClass *klass) GObjectClass *object_class = G_OBJECT_CLASS (klass); object_class->finalize = gtk_css_widget_node_finalize; + node_class->update_style = gtk_css_widget_node_update_style; node_class->validate = gtk_css_widget_node_validate; node_class->queue_validate = gtk_css_widget_node_queue_validate; node_class->dequeue_validate = gtk_css_widget_node_dequeue_validate; |