Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: Troubleshooting issues with xdg-desktop-portal and flatpak on XFCE (Read 1180 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Troubleshooting issues with xdg-desktop-portal and flatpak on XFCE

Hello, I recently switched to the XFCE desktop environment (clean install) so apologies if this is common knowledge.

I have installed a few applications using flatpak, namely Discord. It works fine except I am unable to open any kind of file-chooser. Running it through the terminal I get the following errors:

Code: [Select]
Discord 0.0.31
Gtk-Message: 20:46:21.119: Failed to load module "xapp-gtk3-module"
Gtk-Message: 20:46:21.119: Failed to load module "xapp-gtk3-module"
Gtk-Message: 20:46:21.119: Failed to load module "canberra-gtk-module"
Gtk-Message: 20:46:21.119: Failed to load module "canberra-gtk-module"
[5:1012/204621.157603:ERROR:object_proxy.cc(623)] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/portal/desktop: org.freedesktop.DBus.Error.InvalidArgs: No such interface “org.freedesktop.portal.FileChooser”
[5:1012/204621.157614:ERROR:select_file_dialog_linux_portal.cc(274)] Failed to read portal version property
Starting app.
Starting updater.

Searching around the Arch Wiki and it lead me to believe I needed to install and configure xdg-desktop-portal. I searched for Artix packages xdg-desktop-* and there is no xdg-desktop-portal-xfce, but I see xdg-desktop-portal-xapp mentions it has xfce interfaces, so I installed that, alongside reinstalling xapp, and xdg-desktop-portal just to be safe.

Still getting the same errors. Further reading on the wiki and it seems xdg-desktop-portal-xapp doesn't come with a FileChooser module? (see here https://wiki.archlinux.org/title/XDG_Desktop_Portal)

So I have also installed xdg-desktop-portal-gtk and xdg-desktop-portal-lxqt. Still, the same errors. Clearly I am missing some kind of configuration step. Any help would be appreciated.

Re: Troubleshooting issues with xdg-desktop-portal and flatpak on XFCE

Reply #1
Avoid flatpaks !

For Discord, you have an Appimage version (You have to make it executable before you can use it.) :
https://github.com/srevinsaju/discord-appimage/releases

If you can't find what you're looking for in the artix repositories, you can possibly use Appimages. This is what I do for FreeCAD.

Discord is also available in the extra (arch) repository.

Personally, I activated these repositories :
system
world
galaxy
multiverse

Knowing that this is not without possible risks, I also use the deposits :
extra (arch)
https://wiki.artixlinux.org/Main/Repositories

Chaotic-AUR
https://aur.chaotic.cx/

And when I still can't find what I'm looking for I use trizen to install packages from the AUR repositories.
sudo pacman -Sy trizen
If you are looking for a package you run:
Code: [Select]
trizen <package-name>
For example :
Code: [Select]
trizen discord

In /etc/pacman.conf repositories
system
world
galaxy
omniverse

  must appear before
extra

And if you use it, you put chaotic-AUR at the very end.

Re: Troubleshooting issues with xdg-desktop-portal and flatpak on XFCE

Reply #2
Offtopic but f(l)atpak still has some uses, for instance as a lazy way of running stuff like librewolf on non-glibc distro, or for wayland stuff where the libs are linked weirdly (the alpine based distro on mobile telephone for instance).

AppImage is nicer indeed but the only advantage it has over plain package is that you can run mismatched/older versions, or some proprietary software linked against a particular glibc version etc

The plain elf binary still reigns king :)

@Woodmorning Output of command " pgrep -a 'xdg|dbus' " will possibly help.

LE: and yeah the web client of discord even runs in a browser

Re: Troubleshooting issues with xdg-desktop-portal and flatpak on XFCE

Reply #3
Thanks for the replies.

I wanted to run Discord through flatpak since it sandboxes the application. Since Discord is proprietary, I think this is a good idea. I might be ignorant but I am not sure if AppImage also runs in a sandbox. This may also be the cause of these issues though. That said, I was running on a KDE desktop environment on Artix recently and the filechooser worked through Discord running through a flatpak there, so I know it is possible.

I still find it interesting why I am having this issue and would like to try and nail down a cause, especially if my system is misconfigured in any way. I feel like that could cause issues down the line for not just flatpaks.

As for the output of  `pgrep -a 'xdg|dbus'`:

Code: [Select]
796 /usr/bin/dbus-daemon --system --nofork --nopidfile --print-address=4
1016 dbus-launch --autolaunch adbb587324d2d03a45a47d3865224490 --binary-syntax --close-stderr
1017 /usr/bin/dbus-daemon --syslog-only --fork --print-pid 5 --print-address 7 --session
1065 /usr/bin/dbus-launch --sh-syntax --exit-with-session xfce4-session
1066 /usr/bin/dbus-daemon --syslog --fork --print-pid 5 --print-address 7 --session
1101 /bin/dbus-daemon --config-file=/usr/share/defaults/at-spi2/accessibility.conf --nofork --print-address 11 --address=unix:path=/run/user/1000/at-spi/bus_0
1413 /usr/lib/xdg-desktop-portal
1419 /usr/lib/xdg-document-portal
1424 /usr/lib/xdg-permission-store
1436 /usr/lib/xdg-desktop-portal-xapp
8592 xdg-dbus-proxy --args=42

I am a bit ignorant as to what I am looking at here, but nothing seems out of the ordinary to my eye.

Re: Troubleshooting issues with xdg-desktop-portal and flatpak on XFCE

Reply #4
I was able to get it working. It seems xdg-desktop-portal-xapp doesn't come with a filechooser. Some advice I saw said to install xdg-desktop-portal-gtk alongside xdg-desktop-portal-xapp and that should fix the issue. It did not. I was still missing some configuration to get the functionality I needed.

Here is what I needed to do.

-Install xdg-desktop-portal-xapp
-Install xdg-desktop-portal-gtk
-create a file named XFCE-portals.conf in an xdg-desktop-portal directory that is itself inside of my home directory's .config. I.E: ~/.config/xdg-desktop-portal/

I believe that this file will overwrite the installed xdg-desktop-portal configuration. As such, I just needed to add the following lines into that file (XFCE-portals.conf)

Code: [Select]
[preferred]
default=xapp
org.freedesktop.impl.portal.Settings=xapp;gtk
org.freedesktop.impl.portal.FileChooser=gtk

My flatpak apps now no longer show a warning about not being able to find a filechooser, and I can successfully choose and upload files to discord flatpak through the GUI.