]> Pileus Git - ~andy/gtk/commitdiff
stylecontext: Make queue_invalidate() always work
authorBenjamin Otte <otte@redhat.com>
Mon, 7 May 2012 23:35:00 +0000 (01:35 +0200)
committerBenjamin Otte <otte@redhat.com>
Tue, 8 May 2012 01:58:23 +0000 (03:58 +0200)
Handle both the case where a widget is set and also the case where a
widget path is set.

gtk/gtkstylecontext.c

index 1ed5eb4d4008c4c5d853e0769c9dc2a6efd7ed41..02293b4c1226675dbf5d465f2db91d7012404857 100644 (file)
@@ -663,12 +663,7 @@ static void
 gtk_style_context_cascade_changed (GtkStyleCascade *cascade,
                                    GtkStyleContext *context)
 {
-  GtkStyleContextPrivate *priv = context->priv;
-
-  if (priv->widget)
-    _gtk_style_context_queue_invalidate (context, GTK_CSS_CHANGE_SOURCE);
-  else
-    gtk_style_context_invalidate (context);
+  _gtk_style_context_queue_invalidate (context, GTK_CSS_CHANGE_SOURCE);
 }
 
 static void
@@ -2556,8 +2551,6 @@ gtk_style_context_set_screen (GtkStyleContext *context,
   priv->screen = screen;
 
   g_object_notify (G_OBJECT (context), "screen");
-
-  gtk_style_context_invalidate (context);
 }
 
 /**
@@ -3162,11 +3155,15 @@ _gtk_style_context_queue_invalidate (GtkStyleContext *context,
 
   priv = context->priv;
 
-  if (priv->widget == NULL && priv->widget_path == NULL)
-    return;
-
-  priv->pending_changes |= change;
-  gtk_style_context_set_invalid (context, TRUE);
+  if (priv->widget != NULL)
+    {
+      priv->pending_changes |= change;
+      gtk_style_context_set_invalid (context, TRUE);
+    }
+  else if (priv->widget_path == NULL)
+    {
+      gtk_style_context_invalidate (context);
+    }
 }
 
 /**