loginDialog: only emit session-activated on user action
Right now we emit session-activated any time the bullet moves in the session menu. That includes at startup when picking an item arbitrarily, and any time GDM reports the session was read from the user's account settings. session-activated informs GDM about the newly selected session, so emitting it in response to GDM reporting a session is a bad idea. This commit changes the code to only emit session-activated when the user explicitly activates a session item from the gear menu. Note, we no longer set the active session explicitly at start up. This is a good thing since the item we were picking wasn't necessarily correct. It does means if GDM fails to inform us about the correct default session we'll now show no bullet instead of a bullet on the wrong item. https://bugzilla.gnome.org/show_bug.cgi?id=740142
This commit is contained in:
parent
58827ba36d
commit
e1d9bdbbd6
@ -380,8 +380,6 @@ var SessionMenuButton = new Lang.Class({
|
||||
|
||||
this._activeSessionId = sessionId;
|
||||
this._updateOrnament();
|
||||
|
||||
this.emit('session-activated', this._activeSessionId);
|
||||
},
|
||||
|
||||
close: function() {
|
||||
@ -405,11 +403,9 @@ var SessionMenuButton = new Lang.Class({
|
||||
this._menu.addMenuItem(item);
|
||||
this._items[id] = item;
|
||||
|
||||
if (!this._activeSessionId)
|
||||
this.setActiveSession(id);
|
||||
|
||||
item.connect('activate', Lang.bind(this, function() {
|
||||
this.setActiveSession(id);
|
||||
this.emit('session-activated', this._activeSessionId);
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user