diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/layout/mod.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs index be1ed6b5..4ea806d8 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -542,6 +542,7 @@ impl<W: LayoutElement> Layout<W> { if !ws.has_windows() && idx != mon.active_workspace_idx && idx != mon.workspaces.len() - 1 + && mon.workspace_switch.is_none() { mon.workspaces.remove(idx); @@ -2286,6 +2287,22 @@ mod tests { check_ops_with_options(options, &ops); } + #[test] + fn workspace_cleanup_during_switch() { + let ops = [ + Op::AddOutput(1), + Op::AddWindow { + id: 1, + bbox: Rectangle::from_loc_and_size((0, 0), (100, 200)), + min_max_size: (Size::from((0, 0)), Size::from((i32::MAX, i32::MAX))), + }, + Op::FocusWorkspaceDown, + Op::CloseWindow(1), + ]; + + check_ops(&ops); + } + fn arbitrary_spacing() -> impl Strategy<Value = u16> { // Give equal weight to: // - 0: the element is disabled |
