From c8b67cb84dd380fd4dc30076ba65c2efc0a1d424 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 24 Apr 2014 12:53:22 +0200 Subject: [PATCH] auto-move-windows: Move check for dynamic workspaces Move the check into checkWorkspaces rather than replacing the function conditionally, to handle changes to the setting. https://bugzilla.gnome.org/show_bug.cgi?id=728865 --- extensions/auto-move-windows/extension.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/extensions/auto-move-windows/extension.js b/extensions/auto-move-windows/extension.js index db276855..8c502a6c 100644 --- a/extensions/auto-move-windows/extension.js +++ b/extensions/auto-move-windows/extension.js @@ -91,6 +91,11 @@ function myCheckWorkspaces() { let i; let emptyWorkspaces = new Array(this._workspaces.length); + if (!Meta.prefs_get_dynamic_workspaces()) { + this._checkWorkspacesId = 0; + return false; + } + for (i = 0; i < this._workspaces.length; i++) { let lastRemoved = this._workspaces[i]._lastRemovedWindow; if (lastRemoved && @@ -155,8 +160,7 @@ function myCheckWorkspaces() { function enable() { prevCheckWorkspaces = Main.wm._workspaceTracker._checkWorkspaces; - if (Meta.prefs_get_dynamic_workspaces()) - Main.wm._workspaceTracker._checkWorkspaces = myCheckWorkspaces; + Main.wm._workspaceTracker._checkWorkspaces = myCheckWorkspaces; winMover = new WindowMover(); }