From dc09f990c4a007bd2ce90ec1f6cdc3cc6452e4cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sun, 7 Aug 2022 02:10:22 +0200 Subject: [PATCH] status/network: Keep sensitive when locked Unlike the old menu that restricted almost everything on the lock screen, we went into the completely opposite direction with quick settings and kept everything that does not launch windows available. Extend that line to the network items, but still respect the `network-control` permission. Part-of: --- js/ui/status/network.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/js/ui/status/network.js b/js/ui/status/network.js index 14df7978b..5a351789e 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -1890,20 +1890,16 @@ class Indicator extends PanelMenu.SystemIndicator { try { this._configPermission = await Polkit.Permission.new( 'org.freedesktop.NetworkManager.network-control', null, null); + + this._allSections.forEach(section => { + this._configPermission.bind_property('allowed', + section, 'reactive', + GObject.BindingFlags.SYNC_CREATE); + }); } catch (e) { log(`No permission to control network connections: ${e}`); this._configPermission = null; } - - Main.sessionMode.connect('updated', this._sessionUpdated.bind(this)); - this._sessionUpdated(); - } - - _sessionUpdated() { - const sensitive = - !Main.sessionMode.isLocked && - this._configPermission && this._configPermission.allowed; - this.menu.setSensitive(sensitive); } _onActivationFailed() {