loginDialog: move user list loading after actors are constructed
Right now we queue populating the user list in the middle of setting up the dialog actors. Of course, the actual population happens some time later after going back to the main loop. It's more logical to structure the code so the the actors are instantiated first in one block and then other things after that. This commit moves the user list population enqueuing operation to the bottom of the constuctor. https://bugzilla.gnome.org/show_bug.cgi?id=721868
This commit is contained in:
parent
2d2020a20d
commit
765d0228c0
@ -454,18 +454,6 @@ const LoginDialog = new Lang.Class({
|
||||
this.actor.add_child(this._logoBin);
|
||||
this._updateLogo();
|
||||
|
||||
if (!this._userManager.is_loaded)
|
||||
this._userManagerLoadedId = this._userManager.connect('notify::is-loaded',
|
||||
Lang.bind(this, function() {
|
||||
if (this._userManager.is_loaded) {
|
||||
this._loadUserList();
|
||||
this._userManager.disconnect(this._userManagerLoadedId);
|
||||
this._userManagerLoadedId = 0;
|
||||
}
|
||||
}));
|
||||
else
|
||||
GLib.idle_add(GLib.PRIORITY_DEFAULT, Lang.bind(this, this._loadUserList));
|
||||
|
||||
this._userList.connect('activate',
|
||||
Lang.bind(this, function(userList, item) {
|
||||
this._onUserListActivated(item);
|
||||
@ -481,6 +469,18 @@ const LoginDialog = new Lang.Class({
|
||||
this._sessionMenuButton.actor.show();
|
||||
this._authPrompt.addActorToDefaultButtonWell(this._sessionMenuButton.actor);
|
||||
|
||||
if (!this._userManager.is_loaded)
|
||||
this._userManagerLoadedId = this._userManager.connect('notify::is-loaded',
|
||||
Lang.bind(this, function() {
|
||||
if (this._userManager.is_loaded) {
|
||||
this._loadUserList();
|
||||
this._userManager.disconnect(this._userManagerLoadedId);
|
||||
this._userManagerLoadedId = 0;
|
||||
}
|
||||
}));
|
||||
else
|
||||
GLib.idle_add(GLib.PRIORITY_DEFAULT, Lang.bind(this, this._loadUserList));
|
||||
|
||||
},
|
||||
|
||||
_updateDisableUserList: function() {
|
||||
|
Loading…
Reference in New Issue
Block a user