summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2012-05-08 01:35:00 +0200
committerBenjamin Otte <otte@redhat.com>2012-05-08 03:58:23 +0200
commitf51c9d4154ba1ce4f20f7c4b7f705fe2756cb8ab (patch)
treefdfb64ee01d7f5fa1dc34e095e19cb094e821edb
parenta0f155e83938f6c3e63c312107dee2a970c2eb15 (diff)
downloadgtk+-f51c9d4154ba1ce4f20f7c4b7f705fe2756cb8ab.tar.gz
stylecontext: Make queue_invalidate() always work
Handle both the case where a widget is set and also the case where a widget path is set.
-rw-r--r--gtk/gtkstylecontext.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 1ed5eb4d40..02293b4c12 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -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);
+ }
}
/**