diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2025-03-22 13:52:08 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-03-22 13:57:37 +0300 |
| commit | ed20822ce947198e4106698d7afffd0a832a7b3c (patch) | |
| tree | 8efa601a22f9db500a6b3c8cc88a101c1f13b644 /src/layout/scrolling.rs | |
| parent | e88dfae46fed95a2b302e1d1e805da10c2b95fa1 (diff) | |
| download | niri-ed20822ce947198e4106698d7afffd0a832a7b3c.tar.gz niri-ed20822ce947198e4106698d7afffd0a832a7b3c.tar.bz2 niri-ed20822ce947198e4106698d7afffd0a832a7b3c.zip | |
layout: Reset unfullscreen view offset when removing window
Another old bug found by randomized tests after I expanded the testing mock
window.
Diffstat (limited to 'src/layout/scrolling.rs')
| -rw-r--r-- | src/layout/scrolling.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/layout/scrolling.rs b/src/layout/scrolling.rs index 1fd79256..9bb190a4 100644 --- a/src/layout/scrolling.rs +++ b/src/layout/scrolling.rs @@ -1063,6 +1063,13 @@ impl<W: LayoutElement> ScrollingSpace<W> { let tile = column.tiles.remove(tile_idx); column.data.remove(tile_idx); + // If we're removing a pending-unfullscreen window, we need to clear the stored view + // offset. There might be other pending-unfullscreen windows in this column but that's kind + // of an edge case, don't think we need to handle that. + if column_idx == self.active_column_idx && tile.is_fullscreen() && !column.is_fullscreen { + self.view_offset_before_fullscreen = None; + } + // If one window is left, reset its weight to 1. if column.data.len() == 1 { if let WindowHeight::Auto { weight } = &mut column.data[0].height { |
