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.
This commit is contained in:
Ivan Molodetskikh
2025-11-24 15:59:07 +03:00
parent 9eeedff629
commit 45b45ac29d
2 changed files with 41 additions and 1 deletions
+2 -1
View File
@@ -5399,7 +5399,8 @@ impl<W: LayoutElement> Column<W> {
tile.tile_height_for_window_height(f64::from(requested_size.h));
let min_tile_height = f64::max(1., tile.min_size_nonfullscreen().h);
if self.pending_sizing_mode().is_normal()
if !is_tabbed
&& self.pending_sizing_mode().is_normal()
&& self.scale.round() == self.scale
&& working_size.h.round() == working_size.h
&& gaps.round() == gaps
+39
View File
@@ -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<TestWindow>, id: usize, mut parent_id: usize) -> bool {
if parent_id == id {
return true;