mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-21 02:01:55 +07:00
Clamp single tiled window height
Now that we have floating for taller-than-screen windows.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user