91 GTK+ applications take 20 seconds to start

Created Sunday 23 October 2022


https://github.com/swaywm/sway/wiki#gtk-applications-take-20-seconds-to-start


This is due to GTK+ waiting for xdg-desktop-portal to start via D-Bus. This times out because the D-Bus activated service doesn't know what WAYLAND_DISPLAY to connect to.


This can be fixed by adding the following to your configuration file (eg in OpenBox > autostart):


/usr/bin/exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK &
Alternatively, set GTK_USE_PORTAL=0 in your environment.


More details: https://github.com/swaywm/sway/issues/5732



Make sure to uninstall xdg-desktop-portal fully, and install it again selecting the gtk variant. If you do the fix above is not neccessary.