From 61cf679b8c6c86b62bff1d9e2489320b8a04fa4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 5 Nov 2020 22:09:30 +0100 Subject: [PATCH] auto-move-windows: Exclude sticky windows from empty-check We modify gnome-shell's workspace tracker to only remove empty workspaces from the end. However we currently don't take into account that sticky windows appear on all workspaces, so those are preventing any workspace from getting removed at the moment. Exclude them when determining whether a workspace is empty to get the expected behavior. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/135 --- extensions/auto-move-windows/extension.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/extensions/auto-move-windows/extension.js b/extensions/auto-move-windows/extension.js index d99244c0..b9bc3a00 100644 --- a/extensions/auto-move-windows/extension.js +++ b/extensions/auto-move-windows/extension.js @@ -116,10 +116,12 @@ function myCheckWorkspaces() { let keepAliveWorkspaces = []; let foundNonEmpty = false; for (let i = this._workspaces.length - 1; i >= 0; i--) { - if (!foundNonEmpty) - foundNonEmpty = this._workspaces[i].list_windows().length > 0; - else if (!this._workspaces[i]._keepAliveId) + if (!foundNonEmpty) { + foundNonEmpty = this._workspaces[i].list_windows().some( + w => !w.is_on_all_workspaces()); + } else if (!this._workspaces[i]._keepAliveId) { keepAliveWorkspaces.push(this._workspaces[i]); + } } // make sure the original method only removes empty workspaces at the end