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
This commit is contained in:
Florian Müllner
2014-04-24 19:15:40 +02:00
parent fee5495692
commit c8b67cb84d
+6 -2
View File
@@ -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();
}