[gnome-shell] main: defer startup until we know our session mode



commit 65303d027aa8615b6aabb16e8d3308e2ee7de446
Author: Ray Strode <rstrode redhat com>
Date:   Sun Feb 17 23:02:52 2013 -0500

    main: defer startup until we know our session mode
    
    commit 92083eaf76fc7a5c2ecdd182896583ab5026ddf0 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

 js/ui/main.js |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/main.js b/js/ui/main.js
index 68cd449..d7ba213 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -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();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]