You are not logged in.

#1 2016-06-08 12:51:30

Abaddon
Member
From: Poland
Registered: 2004-05-03
Posts: 249

Firefox 47, dark GTK3 theme doesn't work

Firefox prior to 47 obeyed the rules set in

$ cat ~/.config/gtk-3.0/settings.ini
[Settings]
gtk-application-prefer-dark-theme=1

Thanks to that I had dark Firefox within dark plasma environemnt. After I upgraded Firefox to 47 it is bright and doesn't integrate with my dark theme at all.

How can I restore previous behaviour?


Gnome - The weakest link!
Linux, *not* GNU/Linux!

Offline

#2 2016-06-08 12:58:25

Abaddon
Member
From: Poland
Registered: 2004-05-03
Posts: 249

Re: Firefox 47, dark GTK3 theme doesn't work

Seems that this change is on purpose:
https://bugzilla.mozilla.org/show_bug.cgi?id=1216658
Eh...


Gnome - The weakest link!
Linux, *not* GNU/Linux!

Offline

#3 2016-06-08 20:57:07

Omar007
Member
Registered: 2015-04-09
Posts: 368

Re: Firefox 47, dark GTK3 theme doesn't work

Omg how has it ever been decided that disabling the dark theme would be a good idea for a fix....
Guess we should now submit a bug report at mozilla for the dark theme not working :V

Last edited by Omar007 (2016-06-08 20:57:34)

Offline

#4 2016-06-08 22:43:06

Abaddon
Member
From: Poland
Registered: 2004-05-03
Posts: 249

Re: Firefox 47, dark GTK3 theme doesn't work

Yeah, it's typical solution in GTK/Gnome world. I'm really pissed off.


Gnome - The weakest link!
Linux, *not* GNU/Linux!

Offline

#5 2016-06-09 06:34:00

discon
Member
Registered: 2010-06-28
Posts: 23

Re: Firefox 47, dark GTK3 theme doesn't work

Here's a relevant bug (linked from 1216658): https://bugzilla.mozilla.org/show_bug.cgi?id=1272332

Offline

#6 2016-06-09 08:42:02

Omar007
Member
Registered: 2015-04-09
Posts: 368

Re: Firefox 47, dark GTK3 theme doesn't work

Ok I really couldn't stand the ugliness and clashing white any longer so I reverted the change and rebuild Firefox.. :V

If you use the ABS you should be able to just apply the patch below to undo the change and get your dark theme support back.

--- a/widget/gtk/nsLookAndFeel.cpp	2016-06-01 06:11:44.000000000 +0200
+++ b/widget/gtk/nsLookAndFeel.cpp	2016-06-09 00:35:30.960100232 +0200
@@ -1095,19 +1095,7 @@
     // Gtk manages a screen's CSS in the settings object so we
     // ask Gtk to create it explicitly. Otherwise we may end up
     // 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);
-
-    if (dark) {
-        g_object_set(settings, dark_setting, FALSE, nullptr);
-    }
+    (void)gtk_settings_get_for_screen(gdk_screen_get_default());
 
     GtkWidgetPath *path = gtk_widget_path_new();
     gtk_widget_path_append_type(path, GTK_TYPE_WINDOW);

Offline

#7 2016-06-10 17:39:04

dekellum
Member
Registered: 2016-06-10
Posts: 6

Re: Firefox 47, dark GTK3 theme doesn't work

Jarring. If anyone wanted a browser to ignore gtk settings, they could use chromium instead.  Reverted to 46.0.1-1 for now.

Offline

#8 2016-06-11 04:31:41

gothmog123
Member
Registered: 2012-10-31
Posts: 120

Re: Firefox 47, dark GTK3 theme doesn't work

This has to be  a friggin joke. Come on mozilla...

Offline

#9 2016-06-11 21:35:00

gaim123
Member
From: Poland
Registered: 2015-04-27
Posts: 34

Re: Firefox 47, dark GTK3 theme doesn't work

Offline

#10 2016-06-12 11:50:41

hyphone
Member
Registered: 2015-10-02
Posts: 6

Re: Firefox 47, dark GTK3 theme doesn't work

I'm wondering why the window manager also uses the default non-dark theme here.

Offline

#11 2016-06-12 18:08:42

Corax
Member
Registered: 2013-08-06
Posts: 31

Re: Firefox 47, dark GTK3 theme doesn't work

See my comment on the relevant bug for a workaround that doesn't involve recompiling (also includes an unavoidable rant...): https://bugzilla.mozilla.org/show_bug.c … 272332#c36

Offline

#12 2016-06-17 07:37:21

gothmog123
Member
Registered: 2012-10-31
Posts: 120

Re: Firefox 47, dark GTK3 theme doesn't work

Actually I get it now. They did this because they're rolling out Electrolysis in FF48 which actually breaks userContent.css functionality so you can't fix the dark themes problem. lol!

Offline

#13 2016-06-17 11:58:05

Morn
Member
Registered: 2012-09-02
Posts: 886

Re: Firefox 47, dark GTK3 theme doesn't work

Thanks, gaim123, that theme works very well.

Last edited by Morn (2016-06-17 12:00:31)

Offline

#14 2016-06-23 20:28:23

dekellum
Member
Registered: 2016-06-10
Posts: 6

Re: Firefox 47, dark GTK3 theme doesn't work

@gothmog123 : I didn't get them same thing from the upstream bug reports. This is closest I find:

https://bugzilla.mozilla.org/show_bug.c … 216658#c38

(different theme variants for XUL/chrome and website content) ...is possible with Gtk+, but only on a multi-process architecture like e10s, where the main process could run with dark themes and the web renderer processes could run with light theme.

So Electrolysis would allow supporting/enabling dark theme only in XUL/chrome, which seems to be what most people want, and without the need for the userContent.css workaround.  However it looks like Electrolysis will land (in release, always on) at the earliest in September with Firefox 49.

I've also now used Omar007 suggestion to rebuild Firefox 47 with the dark-theme-disabling change reverted. Shouldn't Arch just  include this patch in its Extra/firefox build until the configurable option for dark theme lands?

https://bugzilla.mozilla.org/show_bug.cgi?id=1272332

Which is currently listed as wontfix in 47 and only included in 50 (November).

Offline

#15 2016-06-24 09:19:19

gothmog123
Member
Registered: 2012-10-31
Posts: 120

Re: Firefox 47, dark GTK3 theme doesn't work

@dekellum:

They might be planning to fix it in the future, but I force enabled Electrolysis right now which caused userContent.css to be broken. BTW it's actually working really well in all other aspects. Finally FF is a little bit closer to Chrome performance.

Would be absolutely wonderful if the Archdevs could patch FF... can we file a request or how does that work?

Last edited by gothmog123 (2016-06-24 10:52:05)

Offline

#16 2016-06-24 19:29:21

Mr. Pjer
Member
From: Zagreb, Croatia
Registered: 2010-05-10
Posts: 18

Re: Firefox 47, dark GTK3 theme doesn't work

Here's a quick way to get the dark theme back.

Assuming your theme is Adwaita, open /usr/share/applications/firefox.desktop and insert env GTK_THEME=Adwaita:dark into every Exec= statement.

E.g.

Exec=firefox %u

becomes

Exec=env GTK_THEME=Adwaita:dark firefox %u

Save the changes and restart Firefox. This file will get overwritten on update, so you'll probably have to do the process again every time Firefox is updated.

It seems the titlebar stays white this way but the actual UI elements turn dark. YMMV.

Last edited by Mr. Pjer (2016-06-24 19:33:23)

Offline

#17 2016-07-16 21:31:14

plm
Member
Registered: 2008-05-05
Posts: 6

Re: Firefox 47, dark GTK3 theme doesn't work

hyphone wrote:

I'm wondering why the window manager also uses the default non-dark theme here.

Using either GTK_THEME or the FTDeepDark kind of work. I already had FTDeepDark and didn't notice but for the window manager.

That is still unresolved. Does reverting the patch also fix the window manager issue? I wonder how it even can affect the window manager.

Offline

#18 2016-07-17 06:57:15

plm
Member
Registered: 2008-05-05
Posts: 6

Re: Firefox 47, dark GTK3 theme doesn't work

Omar007 wrote:

Ok I really couldn't stand the ugliness and clashing white any longer so I reverted the change and rebuild Firefox.. :V

If you use the ABS you should be able to just apply the patch below to undo the change and get your dark theme support back.

I tried this, the title bar is still not dark, but uses the default theme.

Offline

#19 2016-07-18 10:15:04

Omar007
Member
Registered: 2015-04-09
Posts: 368

Re: Firefox 47, dark GTK3 theme doesn't work

That's odd. I'm currently on 47.0.1 still using that patch.

Offline

#20 2016-09-04 20:21:53

arielinux
Member
Registered: 2015-09-12
Posts: 5

Re: Firefox 47, dark GTK3 theme doesn't work

Firefox 48, using the workaround:

Exec=env GTK_THEME=Adwaita:dark firefox %u

This works except for the titlebar - still seeing the titlebar (window decoration) as adwaita light no matter what - anybody found a workaround for this?

Offline

#21 2016-09-05 01:02:31

arielinux
Member
Registered: 2015-09-12
Posts: 5

Re: Firefox 47, dark GTK3 theme doesn't work

arielinux wrote:

Firefox 48, using the workaround:

Exec=env GTK_THEME=Adwaita:dark firefox %u

This works except for the titlebar - still seeing the titlebar (window decoration) as adwaita light no matter what - anybody found a workaround for this?

Note to self: use a custom firefox launcher to fix the titlebar


env GTK_THEME=Adwaita:dark firefox $1 &
sleep 1
xprop -f _GTK_THEME_VARIANT 8u -set _GTK_THEME_VARIANT dark -id $(wmctrl -lx | awk '$3 == "Navigator.Firefox" {print $1}')

Offline

#22 2016-09-05 10:21:32

Omar007
Member
Registered: 2015-04-09
Posts: 368

Re: Firefox 47, dark GTK3 theme doesn't work

I'm currently on Firefox 48.0.2 and still using the patch I posted before so that should still be an option as well.

Offline

#23 2016-09-22 08:04:34

voepew
Member
Registered: 2016-02-29
Posts: 4

Re: Firefox 47, dark GTK3 theme doesn't work

Firefox 49 is out and there is still white title bar when using gnome adwaita dark theme...

Offline

#24 2016-09-22 19:33:04

cestlaz
Member
Registered: 2014-04-21
Posts: 5

Re: Firefox 47, dark GTK3 theme doesn't work

for ff49, try

MOZ_ALLOW_GTK_DARK_THEME=true firefox

should give you the dark theme (if no other instances of ff are running)

See toward the bottom of https://bug98304.bugzilla.mozilla.org/s … id=1272332

Offline

#25 2016-09-23 18:18:03

dekellum
Member
Registered: 2016-06-10
Posts: 6

Re: Firefox 47, dark GTK3 theme doesn't work

And to make this permanent (at least in Gnome 3) you need to override the firefox.desktop app settings:

% cp /usr/share/applications/firefox.desktop ~/.local/share/applications/
% # edit with diff changes:
86c86
< Exec=firefox %u
---
> Exec=env MOZ_ALLOW_GTK_DARK_THEME=true firefox %u
202c202
< Exec=firefox --new-window %u
---
> Exec=env MOZ_ALLOW_GTK_DARK_THEME=true firefox --new-window %u
310c310
< Exec=firefox --private-window %u
---
> Exec=env MOZ_ALLOW_GTK_DARK_THEME=true firefox --private-window %u

Then re-login to Gnome.

Offline

Board footer

Powered by FluxBB