OPINIONATED OMARCHY
TROUBLESHOOTING CORPUS
790
RECORDS
790
AUDITED
0
UNCHECKED
2388
SOURCES
LIVE
wayland-compat medium common DISPUTE

Fix apps taking 20 to 30 seconds to open with several portals installed

omarchyarchendeavouroscachyosmanjarohyprlandwayland
CORRECTED An auditor found the fix wrong or incomplete and rewrote it.
AUDIT NOTE

The diagnosis and the inspection commands are sound, and the 25-second D-Bus timeout is real. Two problems. First, the 'pin the preference' step is a no-op as written: default = hyprland;gtk with FileChooser = gtk is byte-for-byte what the shipped /usr/share/xdg-desktop-portal/hyprland-portals.conf already contains, so copying it into ~/.config changes nothing. Second, the cited omarchy#7944 does not support this fix: in that issue the GTK portal itself is what times out, and the verified resolution was to route FileChooser AWAY from gtk (to Nautilus's own implementation), not toward it. The nuclear autostart script is real Hyprland wiki content but the record inflates the wiki's sleeps (1/2) to 4/4 without saying why.

The cause above was not rewritten and may still contain the error described. The fix below is the corrected version.
RISK

Removing a portal backend that something actually depends on (e.g. removing xdg-desktop-portal-gtk) leaves you with no file chooser at all, and apps will silently fail to open Save/Open dialogs. Remove one at a time and re-test.

Symptom

GUI apps take 20-30 seconds to show a window, or a file-open dialog hangs for ~25 seconds before appearing. Screen sharing may also be broken at the same time. Nothing obvious in the app's own output.

Cause

More than one xdg-desktop-portal backend is installed and they compete for the same D-Bus interfaces, or a backend fails to launch and xdg-desktop-portal blocks on a 25-second D-Bus timeout before falling through. Portal backends declare which interfaces they handle in /usr/share/xdg-desktop-portal/portals/*.portal. When two claim the same one with no preference configured, requests stall.

Fix

See which backends are installed:


pacman -Qs xdg-desktop-portal
ls /usr/share/xdg-desktop-portal/portals/
systemctl --user status 'xdg-desktop-portal*'

On Hyprland you want exactly two: xdg-desktop-portal-hyprland (screencast, screenshot, global shortcuts) and xdg-desktop-portal-gtk (file chooser, everything else). Remove strays such as xdg-desktop-portal-wlr, -gnome or -kde if you are not using those desktops (check first that nothing else pulls them in):


pactree -r xdg-desktop-portal-wlr
sudo pacman -Rns xdg-desktop-portal-wlr

Be aware that default = hyprland;gtk with org.freedesktop.impl.portal.FileChooser = gtk is ALREADY the shipped default in /usr/share/xdg-desktop-portal/hyprland-portals.conf. Writing that same content into ~/.config/xdg-desktop-portal/hyprland-portals.conf changes nothing and will not fix a stall. Only write a user override when you are actually changing the routing, e.g. to the KDE picker:


[preferred]
default = hyprland;gtk
org.freedesktop.impl.portal.FileChooser = kde

Restart the stack:


systemctl --user restart xdg-desktop-portal-hyprland.service xdg-desktop-portal-gtk.service xdg-desktop-portal.service

If the 25s stall persists with only these two backends installed, read the logs before changing config. A backend that is present but hanging (xdg-desktop-portal-gtk: Error: Timeout was reached, as in omarchy#7944) is a different fault from two backends competing:


journalctl --user -u xdg-desktop-portal -u xdg-desktop-portal-gtk -u xdg-desktop-portal-hyprland -b --no-pager | tail -50

If the portals still launch before the environment is ready, the Hyprland wiki's blunt-instrument autostart script works (wiki sleeps are 1 and 2. Raise them only if that is not enough):


#!/bin/sh
sleep 1
killall -e xdg-desktop-portal-hyprland
killall xdg-desktop-portal
/usr/lib/xdg-desktop-portal-hyprland &
sleep 2
/usr/lib/xdg-desktop-portal &

Verify

systemctl --user status xdg-desktop-portal shows no repeated A backend call failed lines, and an app that used to hang (e.g. opening a file dialog in Firefox) responds within a second.

Sources

apps-slow-to-launch-multiple-portals