summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-10-24 16:23:07 -0400
committerMatthias Clasen <mclasen@redhat.com>2014-10-24 16:23:07 -0400
commit4590501854fa41a6aba4307de8808fa956305b19 (patch)
tree57640050ab9423a4a74716c75e1eef4e2aba7e1c
parent385e6beafe7e53911c1f3c1f84e167e5b218244a (diff)
downloadgtk+-4590501854fa41a6aba4307de8808fa956305b19.tar.gz
Properly update the style cascade on screen change
GtkStyleContext was not properly handling the style cascade when setting a screen, causing the inspector global CSS to affect the inspector window, even though the inspector is using a different screen now.
-rw-r--r--gtk/gtkstylecontext.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 04542d7906..37f330d2f0 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -2142,6 +2142,7 @@ gtk_style_context_set_screen (GtkStyleContext *context,
{
GtkStyleContextPrivate *priv;
GtkStyleCascade *screen_cascade;
+ GtkStyleCascade *old_screen_cascade;
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
g_return_if_fail (GDK_IS_SCREEN (screen));
@@ -2151,7 +2152,8 @@ gtk_style_context_set_screen (GtkStyleContext *context,
return;
screen_cascade = _gtk_settings_get_style_cascade (gtk_settings_get_for_screen (screen));
- if (priv->cascade == screen_cascade)
+ old_screen_cascade = _gtk_settings_get_style_cascade (gtk_settings_get_for_screen (priv->screen));
+ if (priv->cascade == old_screen_cascade)
{
gtk_style_context_set_cascade (context, screen_cascade);
}