stylecontext: Copy name when setting widget path

Imitate what we do for the type. This way we don't lose the name on
save/restore.

https://bugzilla.gnome.org/show_bug.cgi?id=758442
This commit is contained in:
Benjamin Otte
2015-11-21 02:21:12 +01:00
parent 7373fd8aab
commit 6eb89fb6a3

View File

@ -1081,14 +1081,18 @@ gtk_style_context_set_path (GtkStyleContext *context,
GtkWidgetPath *copy = gtk_widget_path_copy (path); GtkWidgetPath *copy = gtk_widget_path_copy (path);
gtk_css_path_node_set_widget_path (GTK_CSS_PATH_NODE (root), copy); gtk_css_path_node_set_widget_path (GTK_CSS_PATH_NODE (root), copy);
if (gtk_widget_path_length (copy)) if (gtk_widget_path_length (copy))
gtk_css_node_set_widget_type (root, {
gtk_widget_path_iter_get_object_type (copy, -1)); gtk_css_node_set_widget_type (root,
gtk_widget_path_iter_get_object_type (copy, -1));
gtk_css_node_set_name (root, gtk_widget_path_iter_get_object_name (copy, -1));
}
gtk_widget_path_unref (copy); gtk_widget_path_unref (copy);
} }
else else
{ {
gtk_css_path_node_set_widget_path (GTK_CSS_PATH_NODE (root), NULL); gtk_css_path_node_set_widget_path (GTK_CSS_PATH_NODE (root), NULL);
gtk_css_node_set_widget_type (root, G_TYPE_NONE); gtk_css_node_set_widget_type (root, G_TYPE_NONE);
gtk_css_node_set_name (root, NULL);
} }
} }