init: Postpone start for dynamic imports

Merged Florian Müllner requested to merge fmuellner/gnome-shell:fix-dynamic-imports into main

gjs now has an internal mainloop that it can spin to resolve dynamic imports. That loop uses the thread default context, so its possible that other sources, namely from mutter, get dispatched when iterating the context. If that happens before mutter is properly initialized, this will lead to a crash.

Fix this by moving start() to an idle handler, so it is only called once mutter's own mainloop is running, and dynamic imports cannot happen earlier than that.


Merge request reports