I’m on EndeavourOS (XFCE4 | systemd)
Clicking links in Flatpak apps (e.g. Vesktop) does nothing. xdg-open works fine from the terminal, so the issue was specific to Flatpak.
Both xdg-desktop-portal and xdg-desktop-portal-gtk are installed but are not running — they fail to start with “Dependency failed” and “Current graphical user session is inactive” in the logs.
xdg-desktop-portal requires graphical-session.target to be active before it starts. On GNOME and KDE, the session manager automatically activates this systemd target at login. XFCE does not, so the portal waits forever and never starts, silently dropping all link-open requests from my Flatpak apps.
Below are the duct tape solutions I came up with, for now…
Shadow the system unit file to remove the graphical-session.target dependency:
cp /usr/lib/systemd/user/xdg-desktop-portal.service ~/.config/systemd/user/ && grep -v 'graphical-session' ~/.config/systemd/user/xdg-desktop-portal.service > /tmp/xdgportal.tmp && mv /tmp/xdgportal.tmp ~/.config/systemd/user/xdg-desktop-portal.service && systemctl --user daemon-reload
Add the portal to autostart so it launches at login:
mkdir -p ~/.config/autostart && printf '[Desktop Entry]\nType=Application\nName=XDG Desktop Portal\nExec=systemctl --user start xdg-desktop-portal xdg-desktop-portal-gtk\nHidden=false\nNoDisplay=false\nX-GNOME-Autostart-enabled=true\n' > ~/.config/autostart/xdg-portal.desktop
Set the portal backend explicitly for XFCE:
mkdir -p ~/.config/xdg-desktop-portal && printf '[preferred]\ndefault=gtk\norg.freedesktop.impl.portal.OpenURI=gtk\n' > ~/.config/xdg-desktop-portal/portals.conf
Once the portal started working, Firefox began reading theme information through it. The portal reads from GSettings (org.gnome.desktop.interface) rather than XFCE’s xsettings, and GSettings was empty on a fresh install, causing Firefox’s titlebar/toolbar to appear with wrong colors. Fix:
gsettings set org.gnome.desktop.interface gtk-theme 'Your-Theme-Name' gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
The real fix would be XFCE properly activating graphical-session.target at login, like GNOME and KDE do.
Until XFCE implements full systemd session management, this workaround appears to be necessary.
Does anyone know of a better solution to these issues?