diff options
-rw-r--r-- | gtk/gtkcsswidgetnode.c | 19 | ||||
-rw-r--r-- | gtk/gtkstylecontext.c | 4 | ||||
-rw-r--r-- | gtk/gtkstylecontextprivate.h | 1 |
3 files changed, 21 insertions, 3 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; diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c index 3786e356d5..db75a288fc 100644 --- a/gtk/gtkstylecontext.c +++ b/gtk/gtkstylecontext.c @@ -254,7 +254,7 @@ gtk_style_context_class_init (GtkStyleContextClass *klass) GTK_PARAM_READWRITE)); } -static void +void gtk_style_context_clear_property_cache (GtkStyleContext *context) { GtkStyleContextPrivate *priv = context->priv; @@ -2417,8 +2417,6 @@ gtk_style_context_validate (GtkStyleContext *context, { if (!_gtk_bitmask_is_empty (changes)) gtk_style_context_do_invalidate (context, changes); - - gtk_style_context_clear_property_cache (context); } /** diff --git a/gtk/gtkstylecontextprivate.h b/gtk/gtkstylecontextprivate.h index 331eb60f69..40fd4f171f 100644 --- a/gtk/gtkstylecontextprivate.h +++ b/gtk/gtkstylecontextprivate.h @@ -47,6 +47,7 @@ const GValue * _gtk_style_context_peek_style_property (GtkStyleContext *c GParamSpec *pspec); void gtk_style_context_validate (GtkStyleContext *context, const GtkBitmask*changes); +void gtk_style_context_clear_property_cache (GtkStyleContext *context); gboolean _gtk_style_context_check_region_name (const gchar *str); gboolean _gtk_style_context_resolve_color (GtkStyleContext *context, |