From 45b45ac29d654c0e6759ab996c69dfde40053536 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Mon, 24 Nov 2025 15:59:07 +0300 Subject: layout/tests: Amend check for window-rule tests This check doesn't handle tabbed columns properly (it should find and take the fixed height tile's height); for now just gate it on is_tabbed. --- src/layout/tests.rs | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'src/layout/tests.rs') diff --git a/src/layout/tests.rs b/src/layout/tests.rs index 1942a11f..96491800 100644 --- a/src/layout/tests.rs +++ b/src/layout/tests.rs @@ -3635,6 +3635,45 @@ fn move_window_to_workspace_maximize_and_fullscreen() { assert_eq!(win.pending_sizing_mode(), SizingMode::Normal); } +#[test] +fn tabs_with_different_border() { + let ops = [ + Op::AddOutput(1), + Op::AddWindow { + params: TestWindowParams { + rules: Some(ResolvedWindowRules { + border: niri_config::BorderRule { + on: true, + ..Default::default() + }, + ..ResolvedWindowRules::default() + }), + ..TestWindowParams::new(2) + }, + }, + Op::SwitchPresetWindowHeight { id: None }, + Op::ToggleColumnTabbedDisplay, + Op::AddWindow { + params: TestWindowParams::new(3), + }, + Op::ConsumeOrExpelWindowLeft { id: None }, + ]; + + let options = Options { + layout: niri_config::Layout { + struts: Struts { + left: FloatOrInt(0.), + right: FloatOrInt(0.), + top: FloatOrInt(20000.), + bottom: FloatOrInt(0.), + }, + ..Default::default() + }, + ..Default::default() + }; + check_ops_with_options(options, ops); +} + fn parent_id_causes_loop(layout: &Layout, id: usize, mut parent_id: usize) -> bool { if parent_id == id { return true; -- cgit