Lookup the space using the workspace in window-removed handler

When a window is «always on visible workspace» (ie. stick() is run)
`get_workspace` will return the active workspace, which is incorrect.
This commit is contained in:
Tor Hedin Brønner
2017-09-22 17:06:05 +02:00
parent 51e95bf998
commit 520ecf93c9
+2 -2
View File
@@ -368,12 +368,12 @@ add_handler = (ws, meta_window) => {
meta_window.connect("focus", focus_wrapper)
}
remove_handler = (ws, meta_window) => {
remove_handler = (workspace, meta_window) => {
debug("window-removed", meta_window, meta_window.title);
// Note: If `meta_window` was closed and had focus at the time, the next
// window has already received the `focus` signal at this point.
let space = spaces[meta_window.get_workspace().workspace_index]
let space = spaces[workspace.workspace_index];
let removed_i = space.indexOf(meta_window)
if (removed_i < 0)
return