Skip to content

Commit 4e08237

Browse files
committed
Do not restore the original number of workspaces
The extension is disabled when GNOME is inactive or locked and the reset of workspaces caused windows to move from one workspace to the other. Now changing the number of workspaces in this extension will permanently change the global number of workspaces. If workspaces were set to "dynamic" before the extension is enabled, windows will still jump around. References #29
1 parent 1c9c48c commit 4e08237

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

wsmatrix@martin.zurowietz.de/WmOverride.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ var WmOverride = class {
1919
this.settings = settings;
2020
this._mutterSettings = new Gio.Settings({ schema_id: 'org.gnome.mutter' });
2121
this.wsManager = DisplayWrapper.getWorkspaceManager();
22-
this.originalNumberOfWorkspaces = this.wsManager.n_workspaces;
2322
this.originalDynamicWorkspaces = this._mutterSettings.get_boolean('dynamic-workspaces');
2423
this.originalAllowedKeybindings = {};
2524

@@ -41,7 +40,6 @@ var WmOverride = class {
4140
this._disconnectSettings();
4241
this._restoreKeybindingHandlers();
4342
this._restoreLayout();
44-
this._restoreNumberOfWorkspaces();
4543
this._restoreDynamicWorkspaces();
4644
this._notify();
4745
}
@@ -149,7 +147,7 @@ var WmOverride = class {
149147
this.wsManager.override_workspace_layout(
150148
DisplayWrapper.getDisplayCorner().TOPLEFT, // workspace 0
151149
true, // true == lay out in columns. false == lay out in rows
152-
this.originalNumberOfWorkspaces,
150+
this.rows * this.columns,
153151
1
154152
);
155153
}
@@ -179,10 +177,6 @@ var WmOverride = class {
179177
this._forceNumberOfWorkspaces(this.rows * this.columns);
180178
}
181179

182-
_restoreNumberOfWorkspaces() {
183-
this._forceNumberOfWorkspaces(this.originalNumberOfWorkspaces);
184-
}
185-
186180
_forceNumberOfWorkspaces(total) {
187181
while (this.wsManager.n_workspaces < total) {
188182
this.wsManager.append_new_workspace(false, global.get_current_time());

0 commit comments

Comments
 (0)