[gtk+] widget: Add classes to widget path even if no style context exists yet



commit 775e277ab9753609b45063eb8c0171b3103a252d
Author: Benjamin Otte <otte redhat com>
Date:   Tue Jun 7 16:08:52 2016 +0200

    widget: Add classes to widget path even if no style context exists yet
    
    This removes leftover code from when classes where added to the style
    context.
    Now that they get added directly to css nodes, the classes can exist
    without a style context.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=767312

 gtk/gtkwidget.c |   17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index b5d552d..006be5e 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -16361,6 +16361,8 @@ gint
 gtk_widget_path_append_for_widget (GtkWidgetPath *path,
                                    GtkWidget     *widget)
 {
+  const GQuark *classes;
+  guint n_classes, i;
   gint pos;
 
   g_return_val_if_fail (path != NULL, 0);
@@ -16374,19 +16376,10 @@ gtk_widget_path_append_for_widget (GtkWidgetPath *path,
 
   gtk_widget_path_iter_set_state (path, pos, widget->priv->state_flags);
 
-  if (widget->priv->context)
-    {
-      const GQuark *classes;
-      guint n_classes, i;
+  classes = gtk_css_node_list_classes (widget->priv->cssnode, &n_classes);
 
-      /* Also add any persistent classes in
-       * the style context the widget path
-       */
-      classes = gtk_css_node_list_classes (widget->priv->cssnode, &n_classes);
-
-      for (i = n_classes; i-- > 0;)
-        gtk_widget_path_iter_add_qclass (path, pos, classes[i]);
-    }
+  for (i = n_classes; i-- > 0;)
+    gtk_widget_path_iter_add_qclass (path, pos, classes[i]);
 
   return pos;
 }


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