Fix settings signal issue

This commit is contained in:
2023-05-24 01:23:05 +09:00
parent a112960a35
commit 0054fd050a
3 changed files with 11 additions and 8 deletions
+2 -2
View File
@@ -38,7 +38,7 @@ var BorderManager = GObject.registerClass(
});
if (global.window_group) global.window_group.add_child(this._border);
this._settings.connect("changed", () => {
this._settingsSignal = this._settings.connect("changed", () => {
this.settings = {
show: this._settings.get_boolean("focus-border"),
color: this._settings.get_string("focus-border-color"),
@@ -50,7 +50,7 @@ var BorderManager = GObject.registerClass(
disable() {
log("Removing the border");
this._settings.disconnect("changed");
this._settings.disconnect(this._settingsSignal);
this._border.destroy();
this._border = null;
}
+5 -4
View File
@@ -116,7 +116,9 @@ var Indicator = GObject.registerClass(
this._destroyed = false;
this.update();
this._settings.connect("changed", () => this.update());
this._settingsSignal = this._settings.connect("changed", () =>
this.update()
);
}
disable() {
@@ -132,7 +134,7 @@ var Indicator = GObject.registerClass(
this._layoutIndicator = null;
this._icon = null;
this._settings.disconnect("changed");
this._settings.disconnect(this._settingsSignal);
}
update() {
@@ -184,8 +186,7 @@ var Indicator = GObject.registerClass(
this._windowCount.set_text(windowCount.toString());
if (state.layout === "monocle" || state.layout === "deck")
this._windowCount.show();
else
this._windowCount.hide();
else this._windowCount.hide();
for (const [key, value] of Object.entries(this._layoutPanelItems)) {
value.setOrnament(
key === state.layout
+4 -2
View File
@@ -43,8 +43,10 @@ var Renderer = GObject.registerClass(
this.warpEnabled = this._settings.get_boolean("warp-cursor");
this._state.singleTagset = this._settings.get_boolean("single-tagset");
log("Enabling with state:", JSON.stringify(this._state.windows));
for (const window of global.display.list_all_windows())
this.trackWindow(window);
log("Enabling with state after tracking:", JSON.stringify(this._state.windows));
const workspace = global.display
.get_workspace_manager()
@@ -139,7 +141,7 @@ var Renderer = GObject.registerClass(
}
// We do not remove the state's windows array, we want to keep tags when the user suspend the systme.
this._settings.disconnect("changed");
this._settings.disconnect(this._settingsSignal);
}
_bindSignals() {
@@ -219,7 +221,7 @@ var Renderer = GObject.registerClass(
}),
];
this._settings.connect("changed", (_, key) => {
this._settingsSignal = this._settings.connect("changed", (_, key) => {
log("Proprety changed", key);
switch (key) {
case "gap-size":