summaryrefslogtreecommitdiff
path: root/mozilla-1158076-1.patch
diff options
context:
space:
mode:
Diffstat (limited to 'mozilla-1158076-1.patch')
-rw-r--r--mozilla-1158076-1.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/mozilla-1158076-1.patch b/mozilla-1158076-1.patch
new file mode 100644
index 0000000..e409386
--- /dev/null
+++ b/mozilla-1158076-1.patch
@@ -0,0 +1,51 @@
+diff -up firefox-52.0.2/modules/libpref/init/all.js.1158076-1 firefox-52.0.2/modules/libpref/init/all.js
+--- firefox-52.0.2/modules/libpref/init/all.js.1158076-1 2017-03-31 09:44:28.377647329 +0200
++++ firefox-52.0.2/modules/libpref/init/all.js 2017-03-31 09:46:02.847234586 +0200
+@@ -4646,6 +4646,8 @@ pref("gfx.apitrace.enabled",false);
+ pref("gfx.content.use-native-pushlayer", true);
+ #ifdef MOZ_WIDGET_GTK
+ pref("gfx.xrender.enabled",false);
++pref("widget.chrome.allow-gtk-dark-theme", false);
++pref("widget.content.allow-gtk-dark-theme", false);
+ #endif
+ #endif
+
+diff -up firefox-52.0.2/widget/gtk/nsLookAndFeel.cpp.1158076-1 firefox-52.0.2/widget/gtk/nsLookAndFeel.cpp
+--- firefox-52.0.2/widget/gtk/nsLookAndFeel.cpp.1158076-1 2017-03-31 09:44:28.374647342 +0200
++++ firefox-52.0.2/widget/gtk/nsLookAndFeel.cpp 2017-03-31 09:44:35.125617758 +0200
+@@ -1134,16 +1134,27 @@ nsLookAndFeel::Init()
+ // with wrong color theme, see Bug 972382
+ GtkSettings *settings = gtk_settings_get_for_screen(gdk_screen_get_default());
+
+- // Disable dark theme because it interacts poorly with widget styling in
+- // web content (see bug 1216658).
+- // To avoid triggering reload of theme settings unnecessarily, only set the
+- // setting when necessary.
+ const gchar* dark_setting = "gtk-application-prefer-dark-theme";
+- gboolean dark;
+- g_object_get(settings, dark_setting, &dark, nullptr);
++ gboolean darkThemeDefault;
++ g_object_get(settings, dark_setting, &darkThemeDefault, nullptr);
+
+- if (dark && !PR_GetEnv("MOZ_ALLOW_GTK_DARK_THEME")) {
+- g_object_set(settings, dark_setting, FALSE, nullptr);
++ // Dark themes interacts poorly with widget styling (see bug 1216658).
++ // We disable dark themes by default for all processes (chrome, web content)
++ // but allow user to overide it by prefs.
++ if (darkThemeDefault) {
++ bool allowDarkTheme;
++ if (XRE_IsContentProcess()) {
++ allowDarkTheme =
++ mozilla::Preferences::GetBool("widget.content.allow-gtk-dark-theme",
++ false);
++ } else {
++ allowDarkTheme = (PR_GetEnv("MOZ_ALLOW_GTK_DARK_THEME") != nullptr) ||
++ mozilla::Preferences::GetBool("widget.chrome.allow-gtk-dark-theme",
++ false);
++ }
++ if (!allowDarkTheme) {
++ g_object_set(settings, dark_setting, FALSE, nullptr);
++ }
+ }
+
+ // Scrollbar colors
bgstack15