From b2d2a766e48fb4331370c619bd013c50ba75686a Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Tue, 16 Sep 2025 07:58:24 +0300 Subject: layout: Fix crash when a window opens next-to an only interactively moved window with no outputs --- src/layout/mod.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/layout/mod.rs') diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 243730be..38af83d3 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -1142,7 +1142,15 @@ impl Layout { .filter(|move_| next_to == move_.tile.window().id()) .is_some() { - // The next_to window is being interactively moved. + // The next_to window is being interactively moved. If there are no + // other windows, we may have no workspaces at all. + if workspaces.is_empty() { + workspaces.push(Workspace::new_no_outputs( + self.clock.clone(), + self.options.clone(), + )); + } + (0, WorkspaceAddWindowTarget::Auto) } else { let ws_idx = workspaces -- cgit