nautilus/nautilus-adjust-style-priority.patch

39 lines
1.6 KiB
Diff

From 8c0f5970e71a9b6c786e3e14785f2691c731cd38 Mon Sep 17 00:00:00 2001
From: Sebastian Keller <sebastian-keller@gmx.de>
Date: Fri, 29 Apr 2016 00:13:59 +0200
Subject: 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 file changed, 5 insertions(+), 1 deletion(-)
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);
}
--
cgit v0.12