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.
This commit is contained in:
@ -663,12 +663,7 @@ static void
|
|||||||
gtk_style_context_cascade_changed (GtkStyleCascade *cascade,
|
gtk_style_context_cascade_changed (GtkStyleCascade *cascade,
|
||||||
GtkStyleContext *context)
|
GtkStyleContext *context)
|
||||||
{
|
{
|
||||||
GtkStyleContextPrivate *priv = context->priv;
|
|
||||||
|
|
||||||
if (priv->widget)
|
|
||||||
_gtk_style_context_queue_invalidate (context, GTK_CSS_CHANGE_SOURCE);
|
_gtk_style_context_queue_invalidate (context, GTK_CSS_CHANGE_SOURCE);
|
||||||
else
|
|
||||||
gtk_style_context_invalidate (context);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -2556,8 +2551,6 @@ gtk_style_context_set_screen (GtkStyleContext *context,
|
|||||||
priv->screen = screen;
|
priv->screen = screen;
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (context), "screen");
|
g_object_notify (G_OBJECT (context), "screen");
|
||||||
|
|
||||||
gtk_style_context_invalidate (context);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -3162,12 +3155,16 @@ _gtk_style_context_queue_invalidate (GtkStyleContext *context,
|
|||||||
|
|
||||||
priv = context->priv;
|
priv = context->priv;
|
||||||
|
|
||||||
if (priv->widget == NULL && priv->widget_path == NULL)
|
if (priv->widget != NULL)
|
||||||
return;
|
{
|
||||||
|
|
||||||
priv->pending_changes |= change;
|
priv->pending_changes |= change;
|
||||||
gtk_style_context_set_invalid (context, TRUE);
|
gtk_style_context_set_invalid (context, TRUE);
|
||||||
}
|
}
|
||||||
|
else if (priv->widget_path == NULL)
|
||||||
|
{
|
||||||
|
gtk_style_context_invalidate (context);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gtk_style_context_invalidate:
|
* gtk_style_context_invalidate:
|
||||||
|
|||||||
Reference in New Issue
Block a user