Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ export default class ForgeExtension extends Extension {
this.keybindings?.disable();
this.keybindings = null;
this.extWm = null;
this.themeWm = null;
// The field assigned in enable() is `this.theme`, not `this.themeWm`,
// so the previous statement was a no-op leaving `this.theme` dangling.
this.theme = null;
this.configMgr = null;
this.settings = null;
this.kbdSettings = null;
Expand Down
13 changes: 12 additions & 1 deletion lib/extension/indicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,23 @@ export class FeatureIndicator extends SystemIndicator {

this._indicator.visible = tilingModeEnabled && quickSettingsEnabled;

this.extension.settings.connect("changed", (_, name) => {
// settings is a long-lived Gio.Settings (cached by getSettings()) so we
// must disconnect on destroy — otherwise every enable/disable cycle
// accumulates another handler firing on the previous indicator.
this._settingsChangedId = this.extension.settings.connect("changed", (_, name) => {
switch (name) {
case "tiling-mode-enabled":
case "quick-settings-enabled":
this._indicator.visible = this.extension.settings.get_boolean(name);
}
});
}

destroy() {
if (this._settingsChangedId) {
this.extension.settings.disconnect(this._settingsChangedId);
this._settingsChangedId = 0;
}
super.destroy();
}
}
Loading