From e75a2ca146ddad1f586af196009592ee28db476c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 5 Jan 2024 10:52:08 +0100 Subject: [PATCH] extensions-app: Only change state if necessary The `state-set` signal is emitted to change the underlying state, which can have two reasons: 1. the user toggled the switch 2. the extension's `enabled` state changed externally In the second case, calling enable/disable is pointless at best, and can mess up the expected state by permanently disabling an extension that was disabled because of the global kill switch. Address this by only calling enable/disable if the new state does not already match the current value of the `enabled` property. Close https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7305 Fixes: fec523f83f ("extensions-app: Use new 'enabled' property") Part-of: --- subprojects/extensions-app/js/extensionRow.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/subprojects/extensions-app/js/extensionRow.js b/subprojects/extensions-app/js/extensionRow.js index 5847fb193..dac3b7f01 100644 --- a/subprojects/extensions-app/js/extensionRow.js +++ b/subprojects/extensions-app/js/extensionRow.js @@ -59,7 +59,10 @@ export const ExtensionRow = GObject.registerClass({ this._bindActionEnabled(actionEntries); this._switch.connect('state-set', (sw, state) => { - const {uuid} = this._extension; + const {uuid, enabled} = this._extension; + if (enabled === state) + return true; + if (state) this._app.extensionManager.enableExtension(uuid); else