From 6434bbd682ca841639b065c02e31b111b00a1b6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Hedin=20Br=C3=B8nner?= Date: Sun, 20 Oct 2019 17:34:42 +0200 Subject: [PATCH] insertWindow: insert in correct workspace --- tiling.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tiling.js b/tiling.js index 99b96d5..dae0607 100644 --- a/tiling.js +++ b/tiling.js @@ -2159,7 +2159,17 @@ function insertWindow(metaWindow, {existing}) { return; } - let space = spaces.spaceOfWindow(metaWindow); + // We now handle windows that are on only one workspace + + /* + The window might have moved workspaces, while still being tiled on an old + space. + + Since we delay removing tiled windows until it's added to another space we + need to look at what _workspace_ the window is on, not which _space_. + */ + let workspace = metaWindow.get_workspace(); + let space = spaces.spaceOf(workspace); if (!add_filter(metaWindow)) { connectSizeChanged(); space.addFloating(metaWindow);