mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-21 02:01:55 +07:00
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:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user