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/tests.rs | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'src/layout/tests.rs') diff --git a/src/layout/tests.rs b/src/layout/tests.rs index 6c20acc4..beb4b6ee 100644 --- a/src/layout/tests.rs +++ b/src/layout/tests.rs @@ -2937,6 +2937,39 @@ fn interactive_move_drop_on_other_output_during_animation() { check_ops(&ops); } +#[test] +fn add_window_next_to_only_interactively_moved_without_outputs() { + let ops = [ + Op::AddWindow { + params: TestWindowParams::new(2), + }, + Op::AddOutput(1), + Op::InteractiveMoveBegin { + window: 2, + output_idx: 1, + px: 0.0, + py: 0.0, + }, + Op::InteractiveMoveUpdate { + window: 2, + dx: 0.0, + dy: 3586.692842955048, + output_idx: 1, + px: 0.0, + py: 0.0, + }, + Op::RemoveOutput(1), + // We have no outputs, and the only existing window is interactively moved, meaning there + // are no workspaces either. + Op::AddWindowNextTo { + params: TestWindowParams::new(3), + next_to_id: 2, + }, + ]; + + check_ops(&ops); +} + #[test] fn set_width_fixed_negative() { let ops = [ -- cgit