From 5796a5d1931b1ca87cdbd13c2a26159a7eeb6ddd Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Thu, 1 Aug 2019 16:48:56 +0200 Subject: [PATCH] extensionPrefs: Reflect whether extension is requested in active state To do this, simply use the new isRequested property to properly reflect the underlying settings key rather than the actual loaded state of the extension. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/695 --- js/extensionPrefs/main.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/js/extensionPrefs/main.js b/js/extensionPrefs/main.js index 54900cefc..606f9ecd4 100644 --- a/js/extensionPrefs/main.js +++ b/js/extensionPrefs/main.js @@ -605,8 +605,11 @@ class ExtensionRow extends Gtk.ListBoxRow { this._extension = ExtensionUtils.deserializeExtension(newState); let state = (this._extension.state == ExtensionState.ENABLED); + this._switch.freeze_notify(); this._switch.state = state; + this._switch.active = this._extension.isRequested; this._switch.sensitive = this._canToggle(); + this._switch.thaw_notify(); }); this.connect('destroy', this._onDestroy.bind(this)); @@ -675,7 +678,6 @@ class ExtensionRow extends Gtk.ListBoxRow { this._switch = new Gtk.Switch({ valign: Gtk.Align.CENTER, sensitive: this._canToggle(), - state: this._extension.state === ExtensionState.ENABLED }); this._switch.connect('notify::active', () => { if (this._switch.active) @@ -684,6 +686,11 @@ class ExtensionRow extends Gtk.ListBoxRow { this._app.shellProxy.DisableExtensionRemote(this.uuid); }); this._switch.connect('state-set', () => true); + this._switch.freeze_notify(); + this._switch.state = this._extension.state === ExtensionState.ENABLED; + this._switch.active = this._extension.isRequested; + this._switch.thaw_notify(); + hbox.add(this._switch); }