diff options
author | Benjamin Otte <otte@redhat.com> | 2015-11-21 02:22:22 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2015-11-21 02:22:22 +0100 |
commit | 4b2ea59dd1293f658964506cc540695924cb6499 (patch) | |
tree | 9ac47a19cff8e27caf20f98dd928057d82d3a703 /gtk | |
parent | 6eb89fb6a3861a07e6f7eb8e764772c4fcce6516 (diff) | |
download | gtk+-4b2ea59dd1293f658964506cc540695924cb6499.tar.gz |
stylecontext: Treat empty path like no path
This way, we don't do weird stuff when an empty path is set.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkstylecontext.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c index d07fe1ffdb..4a5c343527 100644 --- a/gtk/gtkstylecontext.c +++ b/gtk/gtkstylecontext.c @@ -1076,16 +1076,13 @@ gtk_style_context_set_path (GtkStyleContext *context, root = gtk_style_context_get_root (context); g_return_if_fail (GTK_IS_CSS_PATH_NODE (root)); - if (path) + if (path && gtk_widget_path_length (path) > 0) { GtkWidgetPath *copy = gtk_widget_path_copy (path); gtk_css_path_node_set_widget_path (GTK_CSS_PATH_NODE (root), 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_name (root, gtk_widget_path_iter_get_object_name (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); } else |