summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsegfault <segfault@riseup.net>2019-03-23 19:20:01 +0100
committersegfault <segfault@riseup.net>2019-03-23 19:22:11 +0100
commit1616d490fa2a700a029eda2946969fc3287bccc7 (patch)
treed029bc61bfaa0cf47203a9edeb86452721767657
parent7e1294556caef133a1aadea0380e5c0c59d25fbf (diff)
status-menu-helper: Show poweroff and reboot buttons when locked (refs: #14556, #15640)
-rw-r--r--config/chroot_local-includes/usr/share/gnome-shell/extensions/status-menu-helper@tails.boum.org/extension.js23
1 files changed, 17 insertions, 6 deletions
diff --git a/config/chroot_local-includes/usr/share/gnome-shell/extensions/status-menu-helper@tails.boum.org/extension.js b/config/chroot_local-includes/usr/share/gnome-shell/extensions/status-menu-helper@tails.boum.org/extension.js
index 7610601..7fd6ce7 100644
--- a/config/chroot_local-includes/usr/share/gnome-shell/extensions/status-menu-helper@tails.boum.org/extension.js
+++ b/config/chroot_local-includes/usr/share/gnome-shell/extensions/status-menu-helper@tails.boum.org/extension.js
@@ -37,17 +37,28 @@ const Extension = new Lang.Class({
Name: 'StatusMenuHelper.Extension',
enable: function() {
+ if (this._isEnabled) return;
+ this._isEnabled = true;
+
this.statusMenu = Main.panel.statusArea['aggregateMenu']._system;
this._createActions();
this._removeAltSwitcher();
this._addSeparateButtons();
- Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
- this._sessionUpdated();
- },
+ this.statusMenu.menu.connect('open-state-changed', (menu, open) => {
+ if (!open)
+ return;
+ this._update();
+ });
+ }
+ ,
disable: function() {
+ // We want to keep the extention enabled on the lock screen
+ if (Main.sessionMode.isLocked) return;
+ this._isEnabled = false;
+
this._destroyActions();
this._restoreAltSwitcher();
},
@@ -144,9 +155,9 @@ const Extension = new Lang.Class({
Util.spawn(['systemctl', 'suspend'])
},
- _sessionUpdated: function() {
- this._lockScreenButton.setSensitive = !Main.sessionMode.isLocked && !Main.sessionMode.isGreeter;
- },
+ _update: function() {
+ this._lockScreenButton.visible = !Main.sessionMode.isLocked && !Main.sessionMode.isGreeter;
+ }
});