gnome-shell/src
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
..
calendar-server
hotplug-sniffer
st
tray
data-to-c.pl
gnome-shell-extension-prefs
gnome-shell-extension-tool.in
gnome-shell-perf-tool.in
gnome-shell-plugin.c init: Move Meta main loop into JavaScript after GJS context is initialized 2023-06-07 19:23:27 +00:00
gnome-shell-portal-helper.c
gtkactionmuxer.c
gtkactionmuxer.h
gtkactionobservable.c
gtkactionobservable.h
gtkactionobserver.c
gtkactionobserver.h
main.c init: Move Meta main loop into JavaScript after GJS context is initialized 2023-06-07 19:23:27 +00:00
meson.build
org.gtk.Application.xml
run-js-test.c
shell-action-modes.h
shell-app-cache-private.h
shell-app-cache.c
shell-app-private.h
shell-app-system-private.h
shell-app-system.c
shell-app-system.h
shell-app-usage.c
shell-app-usage.h
shell-app.c
shell-app.h
shell-blur-effect.c
shell-blur-effect.h
shell-global-private.h
shell-global.c
shell-global.h
shell-glsl-effect.c
shell-glsl-effect.h
shell-invert-lightness-effect.c
shell-invert-lightness-effect.h
shell-keyring-prompt.c
shell-keyring-prompt.h shell: Use G_DECLARE_*_TYPE macros 2015-10-15 22:58:28 +02:00
shell-mount-operation.c
shell-mount-operation.h
shell-network-agent.c
shell-network-agent.h
shell-perf-helper.c
shell-perf-log.c
shell-perf-log.h
shell-polkit-authentication-agent.c
shell-polkit-authentication-agent.h
shell-screenshot.c
shell-screenshot.h
shell-secure-text-buffer.c
shell-secure-text-buffer.h
shell-square-bin.c
shell-square-bin.h
shell-stack.c
shell-stack.h
shell-tray-icon-private.h
shell-tray-icon.c
shell-tray-icon.h
shell-tray-manager.c shell: Move tray implementation away from GtkSocket 2023-03-03 13:34:44 +00:00
shell-tray-manager.h
shell-util.c
shell-util.h
shell-window-preview-layout.c
shell-window-preview-layout.h
shell-window-preview.c
shell-window-preview.h
shell-window-tracker-private.h
shell-window-tracker.c
shell-window-tracker.h
shell-wm-private.h
shell-wm.c
shell-wm.h
shell-workspace-background.c
shell-workspace-background.h