main: defer startup until we know our session mode

commit 92083eaf76 made
session mode loading an asynchronous operation.

Aspects of the session mode aren't known immediately at
start up. For instance, sessionMode.isGreeter returns
false for greeter sessions until the asynchronous
operation completes.

This commit defers start up processing until the session
mode is fully known.

https://bugzilla.gnome.org/show_bug.cgi?id=682429
This commit is contained in:
Ray Strode 2013-02-17 23:02:52 -05:00
parent fae838b054
commit 65303d027a

View File

@ -96,6 +96,15 @@ function start() {
Gio.DesktopAppInfo.set_desktop_env('GNOME');
sessionMode = new SessionMode.SessionMode();
// start session after we know what mode we're running in
let signalId = sessionMode.connect('updated', function() {
sessionMode.disconnect(signalId);
startSession();
});
}
function startSession() {
sessionMode.connect('updated', _loadDefaultStylesheet);
shellDBusService = new ShellDBus.GnomeShell();