diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-12-29 22:22:55 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-12-30 20:12:37 +0300 |
| commit | 6cb5135f3477e63ed1738e19ba95a07ce52093ae (patch) | |
| tree | 54612e364ee8491be56b50e1d8cfef459a3394c2 | |
| parent | 44bf45794e255495e9ee930b019b4bd0e6003428 (diff) | |
| download | niri-6cb5135f3477e63ed1738e19ba95a07ce52093ae.tar.gz niri-6cb5135f3477e63ed1738e19ba95a07ce52093ae.tar.bz2 niri-6cb5135f3477e63ed1738e19ba95a07ce52093ae.zip | |
Clamp single tiled window height
Now that we have floating for taller-than-screen windows.
| -rw-r--r-- | src/layout/scrolling.rs | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/layout/scrolling.rs b/src/layout/scrolling.rs index 73e55451..a378c461 100644 --- a/src/layout/scrolling.rs +++ b/src/layout/scrolling.rs @@ -3553,8 +3553,7 @@ impl<W: LayoutElement> Column<W> { } }; - // If there are multiple windows in a column, clamp the height according to other windows' - // min sizes. + // Clamp the height according to other windows' min sizes, or simply to working area height. let min_height_taken = self .tiles .iter() @@ -3562,12 +3561,10 @@ impl<W: LayoutElement> Column<W> { .filter(|(idx, _)| *idx != tile_idx) .map(|(_, tile)| f64::max(1., tile.min_size().h) + self.options.gaps) .sum::<f64>(); - if min_height_taken > 0. { - let height_left = - self.working_area.size.h - self.options.gaps - min_height_taken - self.options.gaps; - let height_left = f64::max(1., tile.window_height_for_tile_height(height_left)); - window_height = f64::min(height_left, window_height); - } + let height_left = + self.working_area.size.h - self.options.gaps - min_height_taken - self.options.gaps; + let height_left = f64::max(1., tile.window_height_for_tile_height(height_left)); + window_height = f64::min(height_left, window_height); // Clamp it against the window height constraints. let win = &self.tiles[tile_idx].window(); |
