[gtk+] stylecontext: Copy name when setting widget path



commit 6eb89fb6a3861a07e6f7eb8e764772c4fcce6516
Author: Benjamin Otte <otte redhat com>
Date:   Sat Nov 21 02:21:12 2015 +0100

    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

 gtk/gtkstylecontext.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 46be12c..d07fe1f 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -1081,14 +1081,18 @@ gtk_style_context_set_path (GtkStyleContext *context,
       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_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
     {
       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_name (root, NULL);
     }
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]