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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user