system: Do not disable suspend action when locked

gnome-settings-daemon now allows the corresponding keybinding, so
for consistency it makes sense to show the button as well.

https://bugzilla.gnome.org/show_bug.cgi?id=725960
This commit is contained in:
Florian Müllner 2015-03-18 23:54:25 +01:00
parent 1cb644529f
commit 2425b11df6

View File

@ -306,14 +306,17 @@ const Indicator = new Lang.Class({
},
_updateHaveSuspend: function() {
this._loginManager.canSuspend(Lang.bind(this, function(result) {
this._haveSuspend = result;
this._updateSuspend();
}));
this._loginManager.canSuspend(Lang.bind(this,
function(canSuspend, needsAuth) {
this._haveSuspend = canSuspend;
this._suspendNeedsAuth = needsAuth;
this._updateSuspend();
}));
},
_updateSuspend: function() {
let disabled = Main.sessionMode.isLocked ||
let disabled = (Main.sessionMode.isLocked &&
this._suspendNeedsAuth) ||
(Main.sessionMode.isGreeter &&
this._loginScreenSettings.get_boolean(DISABLE_RESTART_KEY));
this._suspendAction.visible = this._haveSuspend && !disabled;