From 2425b11df6d1d5725b58b47199f8985f82d9cd77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 18 Mar 2015 23:54:25 +0100 Subject: [PATCH] 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 --- js/ui/status/system.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/js/ui/status/system.js b/js/ui/status/system.js index 4981d948b..1d666cfb8 100644 --- a/js/ui/status/system.js +++ b/js/ui/status/system.js @@ -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;