atagen

monolith

public
Star0
Watch0

Commit 9c937ba68fa7

tarball

atagen <boss@atagen.co>2026-10-19 08:04 UTC

2 files changed+7-2
layout: only clamp floats when panels reserve space

Rescaling every float by a bar's share of the screen shrank windows a few percent each time a panel appeared, which nobody asked for. A reserved-space change now only keeps floats inside the usable area, and proportional rescaling stays for real area changes.
Modified file: crates/layout/src/outputs.rs+6 additions−2 deletions
@@ -145,9 +145,13 @@ impl Layout {
145145 if out.reserved == reserved {
146146 return false;
147147 }
148- let before = out.usable();
149148 out.reserved = reserved;
150- self.rescale_floats(o, before);
149+ let bounds = out.usable();
150+ for win in self.windows.values_mut().filter(|w| w.output == Some(o)) {
151+ if let Some(rect) = win.float_rect {
152+ win.float_rect = Some(crate::clamp_float(rect, bounds));
153+ }
154+ }
151155 true
152156 }
153157
Modified file: crates/layout/src/tests.rs+1 additions
@@ -661,6 +661,7 @@ fn floats_follow_their_output_area_and_panels() {
661661 let r = l.window(w).unwrap().float_rect.unwrap();
662662 let usable = l.output(o).unwrap().usable();
663663 assert!(r.y >= usable.y && r.bottom() <= usable.bottom());
664+ assert_eq!((r.w, r.h), (200.0, 150.0), "a panel never shrinks a float");
664665 }
665666
666667 #[test]