You are not logged in.

#1 2023-10-08 14:06:13

brian001
Member
Registered: 2021-01-04
Posts: 10

xdg-desktop-portal-gtk and sway needs config file

I use archlinux with sway wm.

After upgrading my xdg-desktop-portal package from 1.16 to 1.18, my gtk4 applications all went to light mode after previously being dark mode.

Apparently, gtk4 apps get their org.gnome.desktop.interface.color-scheme=prefers-dark value through xdg-desktop-portal and xdg-desktop-portal-gtk was failing to run with error "no skeleton to export"

After some digging, I found that this is because xdg-desktop-portal 1.18 requires extra configuration. Gnome is configured correctly, but sway is not.

Here's the info about the new configuration file: https://github.com/flatpak/xdg-desktop- … s-conf.rst

Arch packagers added a gtk-portals.conf file to the xdg-desktop-portal-gtk package and then reverted it. https://gitlab.archlinux.org/archlinux/ … mmits/main

However, the config file name has to match the XDG_CURRENT_DESKTOP environment value, which for me and most sway users will be "sway".

So to fix the problem, we can add a sway-portals.conf file with a value of something like

[preferred]
default=wlr;gtk

The config file can exist as ~/.config/xdg-desktop-portal/sway-portals.conf.

This file should probably exist as /usr/share/xdg-desktop-portal/sway-portals.conf and be added by the sway package as they have done in Alpine linux: https://gitlab.alpinelinux.org/alpine/a … 0395/diffs

Discussion here: https://github.com/flatpak/xdg-desktop- … ssues/1077

It looks like people are on top of it as of yesterday: https://bugs.archlinux.org/task/79883?s … &closedto=

Last edited by brian001 (2023-10-08 14:15:50)

Offline

#2 2023-10-20 08:57:01

danilo
Member
From: Switzerland
Registered: 2010-12-10
Posts: 25
Website

Re: xdg-desktop-portal-gtk and sway needs config file

Thanks for this writeup, took me a while to find the reason why opening the file picker suddenly stopped working. For search-engine-findability, here is the error message when xdg-desktop-portal-gtk isn't being used:

Can't open portal file chooser: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.FileChooser” on object at path /org/freedesktop/portal/desktop

The suggestion with the sway-portals.conf file works perfectly.

From what I read, the proper location to "fix" this is the Arch Linux sway package.


"Freedom is the freedom to say that two plus two make four. If that is granted, all else follows." - George Orwell

Offline

#3 2023-10-21 13:22:24

brian001
Member
Registered: 2021-01-04
Posts: 10

Re: xdg-desktop-portal-gtk and sway needs config file

Well the upgrade from xdg-desktop-portal-gtk 1.14.1-3 to xdg-desktop-portal-gtk 1.15.0-1 broke my dark mode apps again.

It's been noted on the upstream issue tracker. https://github.com/flatpak/xdg-desktop- … gtk/issues

I think I'll just downgrade to the 1.14.1-3 and wait it out.

Edit: upstream has a fix already https://github.com/flatpak/xdg-desktop- … issues/453

Last edited by brian001 (2023-10-21 15:49:45)

Offline

#4 2023-10-22 10:33:18

syncopia
Member
Registered: 2023-10-21
Posts: 1

Re: xdg-desktop-portal-gtk and sway needs config file

This issue has caused notable breakage for me in the KDE Plasma session as well for GTK programs installed as Flatpaks. Many for me started reverting to Adwaita theming and/or rendering text without aliasing. Downgrading xdg-desktop-portal-gtk to 1.14.1-3 for the time being works around the issue for me.

Offline

#5 2023-10-22 15:08:15

Trit
Member
Registered: 2022-12-29
Posts: 5

Re: xdg-desktop-portal-gtk and sway needs config file

Same problem with XFCE and GTK4 apps (like gnome-font-viewer, for example): whether the “org.gnome.desktop.interface.color-scheme” setting is set to “prefers-dark” or not, they will stay with the very white Adwaita GTK4 theme. I could give a try to downgrade xdg-desktop-portal-gtk…

Offline

Board footer

Powered by FluxBB