1

I've tried both the vanilla GNOME session and the Ubuntu session, I've tried using the toggle or the command line ('gsettings set org.gnome.desktop.interface color-scheme prefer-dark'), I've tried .deb apps and Flatpak ones and while all apps respect the light/dark setting, bringing up the file picker in any of them will bring up a light mode version of it even when using dark mode.

Is everyone having the same problem? And if so, have you found a solution?

Edit: Upon further experimentation, some of what I said above seems to not be accurate. For one, some .deb programs will indeed call the dark mode file picker (for example, gnome-text-editor), but they have to be programs that use libadwaita to call on the new file picker, ie. the one that has a thumbnail view. So gnome-text-editor will call the new one, while gedit will call the old one.

But other .debs (notably Chrome) as well as all Flatpaks and Snaps (including libadwaita apps and the Firefox Snap) will call the light mode file picker no matter what. So what I assume is happening is probably a bug with xdg-desktop-portal not being able to detect the light/dark mode preference. I'll keep digging but this lowers my hopes of finding a fix fox this...

Edit 2: I have found this bug which matches the issue. Hopefully it gets activity, so at least it will be useful for tracking. Haven't found a corresponding bug upstream, so I'm now making a VM to see if I can reproduce the issue on other distros using GNOME 44.

Edit 3: Testing on a Fedora Silverblue 38 VM, the issue was not reproducible, so this does seem like an Ubuntu issue.

Philippe Lepaffe
  • 492
  • 1
  • 5
  • 13
  • There is an option you can set using tweaks. It's under the appearance tab. It's about using the dark theme for older applications. Maybe turning on this option let's you get rid of your trouble. – starkus Apr 22 '23 at 16:45
  • Do you mean by setting a dark GTK theme for older applications? That's something I had already done, but is not related to this issue (it only applies to GTK3 programs, and the new file picker is made in GTK4). – Philippe Lepaffe Apr 22 '23 at 17:12
  • Yap, that's what I thought could help. Hope you'll find a fix... – starkus Apr 23 '23 at 06:40

1 Answers1

2

This is happening due to the Ubuntu version of libadwaita not respecting the light/dark choice, probably because of this change https://git.launchpad.net/ubuntu/+source/libadwaita-1/commit/?id=5dadba0afcf778a84aa82a7449ea1e395745b57e.

Here's a lauchpad bug: https://bugs.launchpad.net/ubuntu/+source/libadwaita-1/+bug/2013126

I sent a patch to it, hope it can help

In the meantime, adding ADW_DEBUG_COLOR_SCHEME=prefer-dark to /etc/environment and rebooting should help.

  • Adding the variable to /etc/profile didn't help in my case, but I might be doing it wrong.

    Thanks for sending the patch, hopefully it will get the ball rolling on getting it fixed !

    – Philippe Lepaffe Apr 24 '23 at 11:23
  • 1
    Hm, that's strange. Could you try running ADW_DEBUG_COLOR_SCHEME=prefer-dark /usr/libexec/xdg-desktop-portal-gtk -v -r in a terminal, keep it in the background, and then testing the offending apps? – Gregory Khvatsky Apr 24 '23 at 14:25
  • This command does not work for me either, however ADW_DEBUG_COLOR_SCHEME=prefer-dark /usr/libexec/xdg-desktop-portal-gnome -v -r did. Both Chrome and various Flatpaks properly called on the dark file chooser after doing this (and went back to calling the light mode file chooser upon closing the terminal session).

    As for adding the variable to /etc/profile, again I may just have not done so properly, dealing with environment variables isn't something I do often.

    – Philippe Lepaffe Apr 24 '23 at 15:04
  • 1
    I thunk you should use export ADW_DEBUG_COLOR_SCHEME=prefer-dark in /etc/profile (https://unix.stackexchange.com/questions/117467/how-to-permanently-set-environmental-variables). Sorry for the confusion, I was just doing a lot of experiments with different portals on my machine. – Gregory Khvatsky Apr 24 '23 at 15:20
  • That didn't work either, however adding ADW_DEBUG_COLOR_SCHEME=prefer-dark in /etc/environment did ! I think the reason it didn't work your way is because I use zsh as my shell, not bash. But this works, as far as I can tell. Thanks for pointing me in the right direction !

    I won't mark this as solved quite yet, as I want to wait and see what comes out of the bug report on Launchpad first, but again thanks for the help !

    – Philippe Lepaffe Apr 24 '23 at 15:45
  • Thanks for this! Upgrading libadwaita-1-0 to 1.3.3-0ubuntu0.23.04.1 did the trick for me – hyperair Jun 26 '23 at 07:16