File Chooser not working in Telegram.flatpack and GoogleChrome.rpm

Hello everyone!
After recent updates, file selection dialogs stopped working in applications such as Telegam (flathub) and GoogleChrome (rpm), and possibly in others as well.

My environment:
Sway window manager
XDG_CURRENT_DESKTOP=sway
xdg-desktop-portla-wlr
xdg-desktop-portla-gtk
xdg-desktop-portla-gnome

If I understand correctly, when setting the environment variable XDG_CURRENT_DESKTOP=sway, xdg-desktop-portal-wlr should be used. But it doesn’t support ‘org.freedesktop.potal.FileChooser’.
I removed the xdg-desktop-portla-wlr package, but the file dialogs did not work.
I also tried setting the environment variable XDG_CURRENT_DESKTOP=gnome (or GNOME), this also didn’t work.

I updated the xdg-desktop-portla package to version from Fedora Rawhide, and file dialogs began to open.
Problem with the xdg-desktop-portal 1.16.0-3.fc38 package.

Should I expect a fix in Fedora 38?

Hi, I have similar issue with Fedora 39 and it’s fixed by: https://bodhi.fedoraproject.org/updates/FEDORA-2023-f4e9939da4

I wonder if this is the same issue and we need to backport this change. @alebastr do you know if we are facing the same issue here?

Unlikely. portals.conf requirement was added in xdg-desktop-portal 1.17+, and f38 continues shipping 1.16: xdg-desktop-portal - Fedora Packages.

As far as I’m aware, nothing has been changed in f38 recently that could affect this. Don’t have any f38 machines available at the moment, will try to test on a fresh VM when I’m home.

On a clean up-to-date Fedora 38 (Sway) VM, everything works for me (with Chromium and ASHPD Demo app). I’m afraid there’s nothing we can fix on our side :frowning:

Can you provide the following info:

  • versions of xdg-desktop-portal, xdg-desktop-portal-wlr, xdg-desktop-portal-gtk and sway-systemd packages
  • status of systemd user services for xdg-desktop-portal and all the backends (systemctl --user status xdg-desktop-portal\*.service)
  • output of cat "/proc/$(pidof xdg-desktop-portal)/environ" | tr '\0' '\n' | grep -E '^XDG_|^WAYLAND'
  • check if you either include /etc/sway/config.d/10-systemd-session.conf or have exec dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway (or similar) command in your Sway config

2241173 – File chooser dialog is not showing with sway. Let’s see if that could be addressed in xdg-desktop-portal.
The bug description also offers a workaround (editing /usr/share/xdg-desktop-portal/portals/gtk.portal).

First I rolled back xdg-desktop-portal and glibc packages making dnf distro-sync.
Now I have xdg-desktop-portal* packages from Fedora 38.

  1. versions:
    xdg-desktop-portal - 1.16.0-3.fc38
    xdg-desktop-portal-wlr - 0.6.0-4.fc38
    xdg-desktop-portal-gtk - 1.14.1-2.fc38
    sway-systemd - 0.4.0-1.fc38

  2. status of systemd user services

$ systemctl --user status xdg-desktop-portal\*.service
● xdg-desktop-portal.service - Portal service
     Loaded: loaded (/usr/lib/systemd/user/xdg-desktop-portal.service; static)
    Drop-In: /usr/lib/systemd/user/service.d
             └─10-timeout-abort.conf
     Active: active (running) since Fri 2023-09-29 09:11:05 +04; 12h ago
   Main PID: 1765 (xdg-desktop-por)
      Tasks: 7 (limit: 38111)
     Memory: 4.0M
        CPU: 188ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/xdg-desktop-portal.service
             └─1765 /usr/libexec/xdg-desktop-portal

● xdg-desktop-portal-wlr.service - Portal service (wlroots implementation)
     Loaded: loaded (/usr/lib/systemd/user/xdg-desktop-portal-wlr.service; static)
    Drop-In: /usr/lib/systemd/user/service.d
             └─10-timeout-abort.conf
     Active: active (running) since Fri 2023-09-29 09:11:05 +04; 12h ago
   Main PID: 1873 (xdg-desktop-por)
      Tasks: 9 (limit: 38111)
     Memory: 10.8M
        CPU: 23ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/xdg-desktop-portal-wlr.service
             └─1873 /usr/libexec/xdg-desktop-portal-wlr

● xdg-desktop-portal-gtk.service - Portal service (GTK/GNOME implementation)
     Loaded: loaded (/usr/lib/systemd/user/xdg-desktop-portal-gtk.service; static)
    Drop-In: /usr/lib/systemd/user/service.d
             └─10-timeout-abort.conf
     Active: active (running) since Fri 2023-09-29 09:11:05 +04; 12h ago
   Main PID: 1836 (xdg-desktop-por)
      Tasks: 5 (limit: 38111)
     Memory: 7.1M
        CPU: 97ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/xdg-desktop-portal-gtk.service
             └─1836 /usr/libexec/xdg-desktop-portal-gtk

● xdg-desktop-portal-gnome.service - Portal service (GNOME implementation)
     Loaded: loaded (/usr/lib/systemd/user/xdg-desktop-portal-gnome.service; static)
    Drop-In: /usr/lib/systemd/user/service.d
             └─10-timeout-abort.conf
     Active: active (running) since Fri 2023-09-29 09:29:01 +04; 12h ago
   Main PID: 3703 (xdg-desktop-por)
      Tasks: 5 (limit: 38111)
     Memory: 3.0M
        CPU: 36ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/xdg-desktop-portal-gnome.service
             └─3703 /usr/libexec/xdg-desktop-portal-gnome
  1. cat “/proc/$(pidof xdg-desktop-portal)/environ” | tr ‘\0’ ‘\n’ | grep -E ‘^XDG_|^WAYLAND’
XDG_DATA_DIRS=/home/bazarov/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/
XDG_RUNTIME_DIR=/run/user/1000
XDG_CURRENT_DESKTOP=sway
WAYLAND_DISPLAY=wayland-1
XDG_SESSION_DESKTOP=sway
XDG_SESSION_TYPE=wayland
  1. cat /etc/sway/config.d/10-systemd-session.conf
exec /usr/libexec/sway-systemd/session.sh

I didn’t change the setting in /usr/share/xdg-desktop-portal/portals/gtk.portal.
It’s probably better to override this file in /home/user/.local/share.

I just stopped service xdg-desktop-portlal-gnome

systemctl --user disable --now xdg-desktop-portlal-gnome.service
systemctl --user mask xdg-desktop-portlal-gnome.service

File dialogs now work!

@alebastr couldn’t we solve this by stopping the service when starting Sway? I know it’s an ugly workaround but might be doable?