I guess it’s a problem of xdg-desktop-portal-gtk. I encounter with the same problem on niri (a wayland compositor) today. Some applications is so slow and more than 25s to startup, such as Nautilus and Clash-Verge.
I ask Gemini and find that my xdg-desktop-portal-gtk.service can not start correctly,
❯ systemctl --user status xdg-desktop-portal-gtk
○ xdg-desktop-portal-gtk.service - Portal service (GTK/GNOME implementation)
Loaded: loaded (/etc/systemd/user/xdg-desktop-portal-gtk.service; linked-runtime; preset:>
Active: inactive (dead)
because I use cmd niri(simply a command to bare run niri) to login in, instead of niri-session(a more complete environment initialization script).
And further I investigate journalctl,
❯ journalctl -f --user -u xdg-desktop-portal
Jan 31 23:10:02 kitty systemd[1365]: Starting Portal service (GTK/GNOME implementation)...
Jan 31 23:10:02 kitty xdg-desktop-portal-gtk[35784]: cannot open display:
which agrees with the problem above.
On Niri, using niri-session instead of just niri fixes this. It passes important information (like the screen ID) to the system. Without this, the portal service gets lost and waits for 25s, making apps feel stuck.
Unfortunately, I don’t know how to solve the problem on other desktop. The only thing I know is that background services must be told where the screen is.