Commit fdc620cd authored by Benjamin Otte's avatar Benjamin Otte

cssnode: Clear widget path more aggressively

When recomputing CSS, we need a correct widget path in the fallback mode
where we're still using widget paths.
So we need to invalidate it everytime it actually changes, and not just
when emitting the style-updated signal.

Fixes css-match-regions reftest.
parent 59579576
...@@ -54,6 +54,9 @@ gtk_css_widget_node_style_changed (GtkCssNode *cssnode, ...@@ -54,6 +54,9 @@ gtk_css_widget_node_style_changed (GtkCssNode *cssnode,
node = GTK_CSS_WIDGET_NODE (cssnode); node = GTK_CSS_WIDGET_NODE (cssnode);
if (node->widget)
gtk_widget_clear_path (node->widget);
GTK_CSS_NODE_CLASS (gtk_css_widget_node_parent_class)->style_changed (cssnode, old_style, new_style); GTK_CSS_NODE_CLASS (gtk_css_widget_node_parent_class)->style_changed (cssnode, old_style, new_style);
diff = gtk_css_style_get_difference (new_style, old_style); diff = gtk_css_style_get_difference (new_style, old_style);
...@@ -16400,14 +16400,18 @@ gtk_widget_get_path (GtkWidget *widget) ...@@ -16400,14 +16400,18 @@ gtk_widget_get_path (GtkWidget *widget)
} }
void void
_gtk_widget_style_context_invalidated (GtkWidget *widget) gtk_widget_clear_path (GtkWidget *widget)
{ {
if (widget->priv->path) if (widget->priv->path)
{ {
gtk_widget_path_free (widget->priv->path); gtk_widget_path_free (widget->priv->path);
widget->priv->path = NULL; widget->priv->path = NULL;
} }
_gtk_widget_style_context_invalidated (GtkWidget *widget)
if (gtk_widget_get_realized (widget)) if (gtk_widget_get_realized (widget))
g_signal_emit (widget, widget_signals[STYLE_UPDATED], 0); g_signal_emit (widget, widget_signals[STYLE_UPDATED], 0);
else else
...@@ -148,6 +148,7 @@ gboolean _gtk_widget_captured_event (GtkWidget *widget, ...@@ -148,6 +148,7 @@ gboolean _gtk_widget_captured_event (GtkWidget *widget,
GdkEvent *event); GdkEvent *event);
GtkWidgetPath * _gtk_widget_create_path (GtkWidget *widget); GtkWidgetPath * _gtk_widget_create_path (GtkWidget *widget);
void gtk_widget_clear_path (GtkWidget *widget);
void _gtk_widget_invalidate_style_context (GtkWidget *widget, void _gtk_widget_invalidate_style_context (GtkWidget *widget,
GtkCssChange change); GtkCssChange change);
void _gtk_widget_style_context_invalidated (GtkWidget *widget); void _gtk_widget_style_context_invalidated (GtkWidget *widget);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment