diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2025-09-16 07:58:24 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-09-16 08:35:03 +0300 |
| commit | b2d2a766e48fb4331370c619bd013c50ba75686a (patch) | |
| tree | 8ad3332514f17868d312d83e3717ba72120d43ed /src/layout/mod.rs | |
| parent | cd0d45fdb88641aa5211c81e69301e85c5dd53a2 (diff) | |
| download | niri-b2d2a766e48fb4331370c619bd013c50ba75686a.tar.gz niri-b2d2a766e48fb4331370c619bd013c50ba75686a.tar.bz2 niri-b2d2a766e48fb4331370c619bd013c50ba75686a.zip | |
layout: Fix crash when a window opens next-to an only interactively moved window with no outputs
Diffstat (limited to 'src/layout/mod.rs')
| -rw-r--r-- | src/layout/mod.rs | 10 |
1 files changed, 9 insertions, 1 deletions
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<W: LayoutElement> Layout<W> { .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 |
