Defer initializing UI until after the global session has loaded

https://bugzilla.gnome.org/show_bug.cgi?id=694321
This commit is contained in:
Jasper St. Pierre
2013-02-18 05:26:25 -05:00
parent 1502e308b8
commit 7cdb75e7ce
2 changed files with 15 additions and 16 deletions

View File

@ -158,12 +158,7 @@ function listModes() {
const SessionMode = new Lang.Class({
Name: 'SessionMode',
_init: function() {
global.connect('notify::session-mode', Lang.bind(this, this._sync));
this._modes = _modes;
this._modeStack = [DEFAULT_MODE];
this._sync();
init: function() {
_getModes(Lang.bind(this, function(modes) {
this._modes = modes;
let primary = modes[global.session_mode] &&
@ -171,6 +166,8 @@ const SessionMode = new Lang.Class({
let mode = primary ? global.session_mode : 'user';
this._modeStack = [mode];
this._sync();
this.emit('sessions-loaded');
}));
},