diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2025-09-02 17:20:41 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-09-17 22:04:23 +0300 |
| commit | 318f6ca8cc930684634ca4dca0966d16ed3e1a6b (patch) | |
| tree | 1f453d5ff79a5b3818a017b0cfe33e957a448fe6 /src | |
| parent | c9c28aa4970ed5f9b808a6b989eb6db9de7ef76b (diff) | |
| download | niri-318f6ca8cc930684634ca4dca0966d16ed3e1a6b.tar.gz niri-318f6ca8cc930684634ca4dca0966d16ed3e1a6b.tar.bz2 niri-318f6ca8cc930684634ca4dca0966d16ed3e1a6b.zip | |
layout/tests/fullscreen: Add broken removing tile view pos restore test
Diffstat (limited to 'src')
| -rw-r--r-- | src/layout/tests/fullscreen.rs | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/layout/tests/fullscreen.rs b/src/layout/tests/fullscreen.rs index 2b15767e..7b473325 100644 --- a/src/layout/tests/fullscreen.rs +++ b/src/layout/tests/fullscreen.rs @@ -541,3 +541,57 @@ fn unfullscreen_of_tabbed_via_change_to_normal_preserves_view_pos() { // View pos is back to showing the first window. assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"-16"); } + +#[test] +fn removing_only_fullscreen_tile_updates_view_offset() { + let ops = [ + Op::AddOutput(1), + Op::AddWindow { + params: TestWindowParams::new(1), + }, + Op::AddWindow { + params: TestWindowParams::new(2), + }, + Op::ConsumeOrExpelWindowLeft { id: None }, + Op::SetColumnDisplay(ColumnDisplay::Tabbed), + Op::CompleteAnimations, + ]; + + let mut layout = check_ops(&ops); + + // View pos with gap. + assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"-16"); + + let ops = [ + Op::FullscreenWindow(2), + Op::Communicate(1), + Op::Communicate(2), + Op::CompleteAnimations, + ]; + check_ops_on_layout(&mut layout, &ops); + + // View pos without gap because we went fullscreen. + assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"0"); + + let ops = [ + Op::FullscreenWindow(2), + // The active window responds, the other tabbed window doesn't yet. + Op::Communicate(2), + Op::CompleteAnimations, + ]; + check_ops_on_layout(&mut layout, &ops); + + // View pos without gap because other tile is still fullscreen. + assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"0"); + + let ops = [ + // Expel the fullscreen window from the column, changing the column to non-fullscreen. + Op::ConsumeOrExpelWindowRight { id: Some(1) }, + Op::CompleteAnimations, + ]; + check_ops_on_layout(&mut layout, &ops); + + // View pos should include gap now that the column is no longer fullscreen. + // FIXME: currently, removing a tile doesn't cause the view offset to update. + assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"0"); +} |
