gnome-shell/js
Evan Welsh 8fb8f7f827 init: Move Meta main loop into JavaScript after GJS context is initialized
gjs now has an internal mainloop that it can spin to resolve
module 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.

GjsContext needs to iterate its internal mainloop when initializing
to resolve internal modules, to avoid iterating Meta's mainloop and
triggering events before Meta is ready we will initialize the Shell
global and thus the GjsContext (js_context) before Meta.

Once GjsContext is initialized, we can call meta_context_setup().
Once Meta is setup and started, we'll run init.js which uses GJS'
internal promises API to set a "mainloop hook". The mainloop hook
is run immediately after the module returns so GJS will not attempt
to iterate the main loop again before exiting.

Also adjust the 'headlessStart' test to not wait for the
MetaContext::started signal, as that signal has now already
been emitted when the code is executed.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6691

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2781>
2023-06-07 19:23:27 +00:00
..
dbusServices screencastService: Fix 'pipeline' option 2023-05-30 22:21:12 +00:00
gdm authPrompt: Also replace full-width colon 2023-02-13 20:32:21 +00:00
misc build: Remove Soup2 support 2023-05-26 19:05:22 +00:00
perf init: Move Meta main loop into JavaScript after GJS context is initialized 2023-06-07 19:23:27 +00:00
portalHelper portalHelper: Use libadwaita instead of plain Gtk4 2023-04-25 10:45:19 +00:00
ui init: Move Meta main loop into JavaScript after GJS context is initialized 2023-06-07 19:23:27 +00:00
js-resources.gresource.xml tests/perf: Add test for shutdown with open window 2023-04-20 14:49:38 +02:00
meson.build extensions-app: Move Extensions app to new subproject 2020-03-27 23:33:30 +00:00
portal-resources.gresource.xml js/portal-resources: Add missing fileUtils to js path 2022-11-03 18:02:27 +00:00