Closed Bug 1766339 Opened 3 years ago Closed 3 years ago

(Ubuntu 22.04 - snap) Firefox's modals windows doesn't follow dark theme preference

Categories

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

Firefox 100
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: nicocarbone, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

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

Steps to reproduce:

Set the dark theme in Gnome Settings
Open firefox
Open a modal dialog (eg. Save page as...)

Actual results:

The modal dialog is using the light theme

Expected results:

The modal dialog should use the dark theme as the rest of Firefox

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
Blocks: snap
Priority: -- → P3

This seems like an issue with the upstream GTK portal, I think.

It works correctly for me with Ubuntu 22.04 LTS.

Could you run these commands from a terminal and report the results?

apt cache policy xdg-desktop-portal-gnome

apt cache policy libadwaita-1-0

gsettings get org.gnome.desktop.interface gtk-theme

gsettings get org.gnome.destkop.interface color-scheme

Here is the output of the requested commands:

❯ apt-cache policy xdg-desktop-portal-gnome
xdg-desktop-portal-gnome:
Instalados: 42.0.1-1ubuntu2
Candidato: 42.0.1-1ubuntu2
Tabla de versión:
*** 42.0.1-1ubuntu2 500
500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages
100 /var/lib/dpkg/status
❯ apt-cache policy libadwaita-1-0
libadwaita-1-0:
Instalados: 1.1.0-1ubuntu2
Candidato: 1.1.0-1ubuntu2
Tabla de versión:
*** 1.1.0-1ubuntu2 500
500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages
100 /var/lib/dpkg/status
❯ gsettings get org.gnome.desktop.interface gtk-theme
'Yaru-prussiangreen-dark'
❯ gsettings get org.gnome.desktop.interface color-scheme
'prefer-dark'

The bug is present both in the stable and in the beta versions of firefox. I tried resetting my firefox profile, but it had no effect.

I don't understand why you're seeing this bug.

Do you see this issue with any other apps you have installed?

Create a new user account and log in to that account. Does the new user also have this bug?

Could you provide the output of this command?

snap list

Attached file snap list
I may be doing something wrong. But I can't figure what. I have two computers with 22.04 and in both I have the same problem. I did install the beta version firefox on both, the bug is still there if I revert to the stable version.
Attached file list of snap packages
I may be doing something wrong. But I can't figure what. I have two computers with 22.04 and in both I have the same problem. I did install the beta version firefox on both, the bug is still there if I revert to the stable version.

Ok, I found another app that has the same problem (I think...): telegram-desktop.
But most other do not, like vscode or libreoffice.

Maybe the problem is not firefox? Or both firefox and telegram have the same bug?

Please do check if you experience this issue with a new user account.

Do you have anything in your ~/.config/gtk-4.0/ folder?

I created a new user account and I have the same problem. See here: https://imgur.com/xIlITAb

In the ~/.config/gtk-4.0/ folder I have one file, settings.ini, with the following content:

[Settings]
gtk-application-prefer-dark-theme=0

Please delete ~/.config/gtk-4.0/settings.ini

What do you have in your ~/.config/gtk-3.0/settings.ini file?

Well...
Deleting settings.ini from ~/.config/gtk-4.0/ now makes the modal dark. But now it is dark even when using a light theme. Essentially, the opposite issue than before :/

gtk-3.0 settings.ini is the same as gtk-4.0:

[Settings]
gtk-application-prefer-dark-theme=0

Please remove ~/.config/gtk-3.0/settings.ini

Log out and log back in after switching your theme from dark to light or from light to dark.

I removed gtk-3.0/settings.ini. Changed to the light theme and restarted the PC. Upon restart, the light theme was of course applied and firefox's model dialogs were also light. Then I changed back to the dark theme and I am back to square one, firefox is using the dark theme, but the modals are light.

Did you log out and log back in after changing your theme to dark?

Another data point: I restarted the PC with the dark theme applied. Upon restart, now the modals dialog are dark as they should be. And they stay dark if I change the theme.

So, If I understand this correctly, the modal dialogs use the theme that was applied on login and don't follow changes until next login?

(In reply to nicocarbone from comment #16)

So, If I understand this correctly, the modal dialogs use the theme that was applied on login and don't follow changes until next login?

That's what it looks like. I think this is a bug with the xdg-desktop-portal* systemd user services.

I don't believe there's anything that needs to be done on the Firefox side so I recommend that this bug be closed. I don't yet have permissions to do that myself.

Ok. Thank you for your help!
I will report the bug on launchpad against xdg-desktop-portal.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years 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: