File-roller not respecting GTK4 system-wide dark-mode preference

Since some time (unsure since when) when starting file-roller I get this warning:
(file-roller:931599): Adwaita-WARNING **: 10:24:39.085: Using GtkSettings:gtk-application-prefer-dark-theme with libadwaita is unsupported. Please use AdwStyleManager:color-scheme instead.

As a consequence, file-roller does not respect my preference for dark-mode for GTK applications. I think I have a dark-mode system-wide preference set in all relevant places:

Since it used to work and it just changed after an update, I opened a ticket (with more details about my setup):

I was redirected here, so here I am. Has anybody any suggestions?

Thanks

Applications using libadwaita should use the appropriate API instead of using GtkSettings; additionally, libadwaita only uses the Settings xdg-desktop-portal to query the style to be used (light/dark, high contrast, or the accent colors). You need to ensure you’re starting the desktop portal in your session, and that you configured it correctly to start a portal implementation that supports the Settings interface. You should ask on a user support forum for Sway.

Ok, talked to the Sway folks and they confirm that Sway does not implement the Settings interface and that they don’t plan to do it.

IIUC, the following configuration should use the GTK portal as fallback:

$ cat /usr/share/xdg-desktop-portal/portals/gtk.portal
[portal]
DBusName=org.freedesktop.impl.portal.desktop.gtk
Interfaces=org.freedesktop.impl.portal.FileChooser;org.freedesktop.impl.portal.AppChooser;org.freedesktop.impl.portal.Print;org.freedesktop.impl.portal.Notification;org.freedesktop.impl.portal.Inhibit;org.freedesktop.impl.portal.Access;org.freedesktop.impl.portal.Account;org.freedesktop.impl.portal.Email;org.freedesktop.impl.portal.DynamicLauncher;org.freedesktop.impl.portal.Lockdown;org.freedesktop.impl.portal.Settings;
UseIn=gnome

$ cat ~/.config/xdg-desktop-portal/sway-portals.conf
[preferred]
default=wlr;gtk;

But for some reason it doesn’t :person_shrugging:

Hi,

If portals don’t work, try to set the environment variable ADW_DISABLE_PORTAL=1

Libadwaita apps will then directly read the gsettings, instead of tring to read them through portals.

That’s not suitable if you use flatpaks, but for native apps it should help.

Seems that in my case this helped fixing the issue:
gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'

(still get the warning, though)

even without bypassing the portal with ADW_DISABLE_PORTAL.

@gwillems thanks anyway for the tip. Do you know where is ADW_DISABLE_PORTAL documented? I see it mentioned in many places but didn’t find an authoritative source. I could only find it mentioned in settings: Be less greedy with color-scheme handling (!817) · Merge requests · GNOME / libadwaita · GitLab

thanks

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.