diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c index 186f89db08..6dc69b8c49 100644 --- a/gtk/gtkcontainer.c +++ b/gtk/gtkcontainer.c @@ -1855,7 +1855,6 @@ gtk_container_idle_sizer (GdkFrameClock *clock, container->priv->restyle_pending = FALSE; gtk_css_node_validate (gtk_style_context_get_root (gtk_widget_get_style_context (GTK_WIDGET (container))), current_time, - 0, empty); _gtk_bitmask_free (empty); diff --git a/gtk/gtkcssnode.c b/gtk/gtkcssnode.c index 9d7c0cbc76..36a108f16a 100644 --- a/gtk/gtkcssnode.c +++ b/gtk/gtkcssnode.c @@ -628,12 +628,31 @@ gtk_css_node_invalidate (GtkCssNode *cssnode, gtk_css_node_set_invalid (cssnode, TRUE); } +static void +gtk_css_node_propagate_pending_changes (GtkCssNode *cssnode) +{ + GtkCssChange change; + GtkCssNode *child; + + if (!cssnode->invalid) + return; + + change = _gtk_css_change_for_child (cssnode->pending_changes); + + for (child = gtk_css_node_get_first_child (cssnode); + child; + child = gtk_css_node_get_next_sibling (child)) + { + gtk_css_node_invalidate (child, change); + } +} + void gtk_css_node_validate (GtkCssNode *cssnode, gint64 timestamp, - GtkCssChange change, const GtkBitmask *parent_changes) { + GtkCssChange change; GtkCssNode *child; GtkBitmask *changes; @@ -655,20 +674,20 @@ gtk_css_node_validate (GtkCssNode *cssnode, if (!cssnode->invalid && change == 0 && _gtk_bitmask_is_empty (parent_changes)) return; + gtk_css_node_propagate_pending_changes (cssnode); + gtk_css_node_set_invalid (cssnode, FALSE); - change |= cssnode->pending_changes; + change = cssnode->pending_changes; cssnode->pending_changes = 0; changes = GTK_CSS_NODE_GET_CLASS (cssnode)->validate (cssnode, timestamp, change, parent_changes); - change = _gtk_css_change_for_child (change); - for (child = gtk_css_node_get_first_child (cssnode); child; child = gtk_css_node_get_next_sibling (child)) { - gtk_css_node_validate (child, timestamp, change, changes); + gtk_css_node_validate (child, timestamp, changes); } _gtk_bitmask_free (changes); diff --git a/gtk/gtkcssnodeprivate.h b/gtk/gtkcssnodeprivate.h index e0f60e5b66..25e4cfa5ba 100644 --- a/gtk/gtkcssnodeprivate.h +++ b/gtk/gtkcssnodeprivate.h @@ -126,7 +126,6 @@ void gtk_css_node_invalidate (GtkCssNode * GtkCssChange change); void gtk_css_node_validate (GtkCssNode *cssnode, gint64 timestamp, - GtkCssChange change, const GtkBitmask *parent_changes); void gtk_css_node_set_invalid (GtkCssNode *node, gboolean invalid); diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 32a3b2c1f7..14d4723218 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -5851,7 +5851,6 @@ gtk_window_show (GtkWidget *widget) empty = _gtk_bitmask_new (); gtk_css_node_validate (gtk_style_context_get_root (gtk_widget_get_style_context (widget)), g_get_monotonic_time (), - 0, empty); _gtk_bitmask_free (empty);