Closed Bug 1990464 Opened 1 year ago Closed 1 month ago

[KDE] Firefox not detecting system theme properly

Categories

(Core :: Widget: Gtk, defect, P3)

Firefox 156
Desktop
Linux
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: mira.jary, Unassigned)

References

(Blocks 2 open bugs)

Details

Attachments

(6 files)

Attached file sysdetails.txt —

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:143.0) Gecko/20100101 Firefox/143.0

Steps to reproduce:

  1. Open KDE Settings
  2. Set color theme to light (e.g. Breeze Light)

Actual results:

Firefox kept dark mode when light OS mode was set.

Expected results:

Firefox should reflect the change and switch to light theme.

I'll also add that Thunderbird reacts properly and switches to light/dark mode accordingly to KDE settings

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core

Emilio, any idea here?
Thanks.

Flags: needinfo?(emilio)
Summary: Firefox not detecting system theme properly → [KDE] Firefox not detecting system theme properly

I can't repro this. Reporter, can you run firefox with:

MOZ_LOG=LookAndFeel:5 firefox >log.txt 2>&1

And attach log.txt here? Also attach your about:support information.

If you could try with a clean profile (mkdir /tmp/temp-profile; firefox -profile /tmp/temp-profile), does it reproduce the issue?

Flags: needinfo?(emilio) → needinfo?(mira.jary)
Attached file about_support.txt —
Flags: needinfo?(mira.jary)
Attached file log.txt —

I've attached both files (while collecting the logs I've toggled to light color theme and back to dark one).

Also I can confirm this is reproducible on freshly created profile on my machine.

So your color scheme preference is 1 (dark), good. Then you switch to the light theme and we get this:

[Parent 9272: Main Thread]: D/LookAndFeel Settings Change sender=:1.15 signal=SettingChanged params=('org.freedesktop.appearance', 'color-scheme', <uint32 2>)
[Parent 9272: Main Thread]: D/LookAndFeel RecomputeDBusAppearanceSetting(color-scheme, uint32 2)
[Parent 9272: Main Thread]: D/LookAndFeel OverrideSystemThemeIfNeeded(matchesSystem=1, usingSystem=1)
[Parent 9272: Main Thread]: D/LookAndFeel UpdateRoundedBottomCornerStyles(0px -> 0px)
[Parent 9272: Main Thread]: D/LookAndFeel Settings Change sender=:1.15 signal=SettingChanged params=('org.freedesktop.appearance', 'accent-color', <(0.36078432202339172, 0.70196080207824707, 0.87058824300765991)>)
[Parent 9272: Main Thread]: D/LookAndFeel RecomputeDBusAppearanceSetting(accent-color, (0.36078432202339172, 0.70196080207824707, 0.87058824300765991))
[Parent 9272: Main Thread]: D/LookAndFeel Settings Change sender=:1.15 signal=SettingChanged params=('org.freedesktop.appearance', 'color-scheme', <uint32 2>)
[Parent 9272: Main Thread]: D/LookAndFeel RecomputeDBusAppearanceSetting(color-scheme, uint32 2)
[Parent 9272: Main Thread]: D/LookAndFeel Settings Change sender=:1.15 signal=SettingChanged params=('org.freedesktop.appearance', 'accent-color', <(0.36078432202339172, 0.70196080207824707, 0.87058824300765991)>)
[Parent 9272: Main Thread]: D/LookAndFeel RecomputeDBusAppearanceSetting(accent-color, (0.36078432202339172, 0.70196080207824707, 0.87058824300765991))
[Parent 9272: Main Thread]: D/LookAndFeel Settings Change sender=:1.15 signal=SettingChanged params=('org.kde.kdeglobals.General', 'ColorScheme', <'KlassyLight'>)
[Parent 9272: Main Thread]: D/LookAndFeel OverrideSystemThemeIfNeeded(matchesSystem=1, usingSystem=1)
[Parent 9272: Main Thread]: D/LookAndFeel Update
RoundedBottomCornerStyles(0px -> 0px)
[Parent 9272: Main Thread]: D/LookAndFeel Settings Change sender=:1.15 signal=SettingChanged params=('org.gnome.desktop.interface', 'color-scheme', <'default'>)
[Parent 9272: Main Thread]: D/LookAndFeel Settings Change sender=:1.15 signal=SettingChanged params=('org.freedesktop.appearance', 'color-scheme', <uint32 0>)
[Parent 9272: Main Thread]: D/LookAndFeel RecomputeDBusAppearanceSetting(color-scheme, uint32 0)

We seem to be getting two messages, once with 2 (light) and another one with 0 (which is default but should also be interpreted as light).

And I guess that Firefox remains dark? Given the Klassy color scheme in the logs there's probably some KDE customizations here at play. Can you point out which ones those are?

Also, does firefox pick up the right color scheme after a restart? Or does it remain dark?

Flags: needinfo?(mira.jary)
Attached file log_breeze.txt —

The same behavior with the default "Breeze" color schemes in KDE; attaching the log.

Firefox remains reporting dark mode even after restarting the app; although the toolbar seems to be a bit lighter (but still dark). Will attach comparison.

Flags: needinfo?(mira.jary)
Attached image toolbar_light_mode.png —
Attached image toolbar_dark_mode.png —
Severity: -- → S3
OS: Unspecified → Linux
Hardware: Unspecified → Desktop
Version: Firefox 143 → Firefox 144

Can confirm this is still reproducible with Firefox 144 and KDE Plasma 6.5.0

Operating System: Arch Linux 
KDE Plasma Version: 6.5.0
KDE Frameworks Version: 6.19.0
Qt Version: 6.10.0
Kernel Version: 6.17.4-zen2-1-zen (64-bit)
Graphics Platform: Wayland
Processors: 12 × 13th Gen Intel® Core™ i5-13420H
Memory: 32 GiB of RAM (31,1 GiB usable)
Graphics Processor 1: Mesa Intel® Graphics
Graphics Processor 2: NVIDIA GeForce RTX 4050 Laptop GPU/PCIe/SSE2
Manufacturer: LENOVO
Product Name: 82XV
System Version: LOQ 15IRH8

What does ps -aux | grep portal say? I'd be happy to fix it if I could repro, I suspect you have multiple settings portal or other such misconfigurations...

Flags: needinfo?(mira.jary)

Sure! Here's the output

jukka@LenovoLOQ ~$ ps -aux | grep portal
jukka       1555  0.0  0.0 903284 20000 ?        Ssl  14:08   0:00 /usr/lib/xdg-desktop-portal
jukka       1567  0.0  0.0 689400  8688 ?        Ssl  14:08   0:00 /usr/lib/xdg-document-portal
root        1573  0.0  0.0   2728  1992 ?        Ss   14:08   0:00 fusermount3 -o rw,nosuid,nodev,fsname=portal,auto_unmount,subtype=portal -- /run/user/1000/doc
jukka       1621  0.0  0.2 489988 72032 ?        Sl   14:08   0:00 /usr/bin/Xwayland :0 -auth /run/user/1000/xauth_UBkzzj -listenfd 8 -listenfd 9 -displayfd 109 -wm 111 -rootless -enable-ei-portal
jukka       2162  0.0  0.0 528904 28848 ?        Ssl  14:08   0:00 /usr/lib/xdg-desktop-portal-gtk
jukka       2234  0.0  0.2 827124 76456 ?        Ssl  14:08   0:00 /usr/lib/xdg-desktop-portal-kde
jukka       5900  0.0  0.0   9292  6212 pts/2    S+   14:22   0:00 grep --color=auto portal

Flags: needinfo?(mira.jary)
Priority: -- → P3
Version: Firefox 144 → Firefox 147

Can confirm this is still an issue in Firefox 147.0.3

Operating System: Arch Linux
KDE Plasma Version: 6.5.5
KDE Frameworks Version: 6.23.0
Qt Version: 6.10.2
Kernel Version: 6.18.9-zen1-2-zen (64-bit)
Graphics Platform: Wayland
Processors: 12 × 13th Gen Intel® Core™ i5-13420H
Memory: 32 GiB of RAM (31,1 GiB usable)
Graphics Processor 1: Mesa Intel® Graphics
Graphics Processor 2: NVIDIA GeForce RTX 4050 Laptop GPU/PCIe/SSE2
Manufacturer: LENOVO
Product Name: 82XV
System Version: LOQ 15IRH8

Version: Firefox 147 → Firefox 149

Confirming this is still an issue in Firefox 152.0.1.

Operating System: Arch Linux
KDE Plasma Version: 6.7.0
KDE Frameworks Version: 6.27.0
Qt Version: 6.11.1
Kernel Version: 7.0.12-zen1-1-zen (64-bit)
Graphics Platform: Wayland
Processors: 12 × 13th Gen Intel® Core™ i5-13420H
Memory: 32 GiB of RAM (31,1 GiB usable)
Graphics Processor 1: Mesa Intel® Graphics
Graphics Processor 2: NVIDIA GeForce RTX 4050 Laptop GPU/PCIe/SSE2
Manufacturer: LENOVO
Product Name: 82XV
System Version: LOQ 15IRH8

Version: Firefox 149 → Firefox 152

Sadly this is still an issue in Firefox 156.0

Operating System: Arch Linux
KDE Plasma Version: 6.7.5
KDE Frameworks Version: 6.30.0
Qt Version: 6.11.2
Kernel Version: 7.2.6-zen2-1-zen (64-bit)
Graphics Platform: Wayland
Processors: 12 × 13th Gen Intel® Core™ i5-13420H
Memory: 32 GiB of RAM (31,1 GiB usable)
Graphics Processor 1: Mesa Intel® Graphics
Graphics Processor 2: NVIDIA GeForce RTX 4050 Laptop GPU/PCIe/SSE2
Manufacturer: LENOVO
Product Name: 82XV
System Version: LOQ 15IRH8

Version: Firefox 152 → Firefox 156

Seems like you have two portals running (/usr/lib/xdg-desktop-portal-gtk, /usr/lib/xdg-desktop-portal-kde) and they're sending conflicting messages, so looks like a misconfiguration on your end unless I'm missing something.

This should not be a problem; both portals are required on arch linux by a different parts of the system (and the gtk portal auto-launches when firefox is opened).

Interestingly enough, as I've mentioned above, the bug does not appear in Thunderbird; there the toggling behaves correctly.

I guess you're right that both portals are fine running together but I also use Arch and I don't see this so there must be something else on your end missing or what not.

Maybe you're missing kde-gtk-config? That should propagate the KDE settings to the gtk settings. Or something along those lines?

Nope, that is installed.

I did a bit of poking around and found out that this is some kind of misconfiguration of my browser profile. When I try to replicate this with a newly created profile, or even create a new system user and try to replicate the issue there, I'm no longer able to.

Any ideas what Firefox config could cause this?

Well, never mind... Found it...

In about:config I found out that there was an option ui.systemUsesDarkTheme set to 1; removing the setting from the config completely fixed the issue. No idea how it got set or why...

Ok, that disagrees with comment 6... But sure, that explains. FWIW on nightly there's an about:preferences -> Appearance section changing that setting but not sure how you could set it in stable without about:config.

Status: UNCONFIRMED → RESOLVED
Closed: 1 month ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: