[nautilus/gnome-3-20] application: Fix white desktop after changing themes



commit 8c0f5970e71a9b6c786e3e14785f2691c731cd38
Author: Sebastian Keller <sebastian-keller gmx de>
Date:   Fri Apr 29 00:13:59 2016 +0200

    application: Fix white desktop after changing themes
    
    Changing the theme to Adwaita was causing the Adwaita.css style provider
    to get added after the nautilus.css style provider. This caused the
    Adwaita.css provider to override the nautilus.css provider, because the
    behavior of two style providers with the same priority is undefined and
    gtk happens to prefer the style provider that got added last.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=765687

 src/nautilus-application.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index 4bc924d..38e3a25 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -1116,9 +1116,13 @@ theme_changed (GtkSettings *settings)
                permanent_provider = gtk_css_provider_new ();
                file = g_file_new_for_uri ("resource:///org/gnome/nautilus/css/nautilus.css");
                gtk_css_provider_load_from_file (permanent_provider, file, NULL);
+               /* The behavior of two style providers with the same priority is
+                * undefined and gtk happens to prefer the provider that got added last.
+                * Use a higher priority here to avoid this problem.
+                */
                gtk_style_context_add_provider_for_screen (screen,
                                                           GTK_STYLE_PROVIDER (permanent_provider),
-                                                          GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+                                                          GTK_STYLE_PROVIDER_PRIORITY_APPLICATION + 1);
                g_object_unref (file);
        }
 


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