diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-12-25 17:26:05 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-12-30 20:12:37 +0300 |
| commit | 2f380de73b0c4c6dddcd14ff71260c0882213077 (patch) | |
| tree | bc0febcede9e968761ffcdc419eeca0c5e726730 /src/layout/floating.rs | |
| parent | e3a9a39c9aa106186272b60cda3d5a5177e7ee33 (diff) | |
| download | niri-2f380de73b0c4c6dddcd14ff71260c0882213077.tar.gz niri-2f380de73b0c4c6dddcd14ff71260c0882213077.tar.bz2 niri-2f380de73b0c4c6dddcd14ff71260c0882213077.zip | |
floating: Take into account non-fixed min/max size window rule
Diffstat (limited to 'src/layout/floating.rs')
| -rw-r--r-- | src/layout/floating.rs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/layout/floating.rs b/src/layout/floating.rs index dfeb18c1..39adf7aa 100644 --- a/src/layout/floating.rs +++ b/src/layout/floating.rs @@ -20,7 +20,7 @@ use crate::render_helpers::RenderTarget; use crate::utils::transaction::TransactionBlocker; use crate::utils::{ center_preferring_top_left_in_area, clamp_preferring_top_left_in_area, ensure_min_max_size, - ResizeEdge, + ensure_min_max_size_maybe_zero, ResizeEdge, }; use crate::window::ResolvedWindowRules; @@ -386,15 +386,14 @@ impl<W: LayoutElement> FloatingSpace<W> { // fullscreen until now), fall back to (0, 0). floating_size.unwrap_or_else(|| win.expected_size().unwrap_or_default()) }; - // Make sure fixed-size through window rules keeps working. + + // Apply min/max size window rules. If requesting a concrete size, apply completely; if + // requesting (0, 0), apply only when min/max results in a fixed size. let min_size = win.min_size(); let max_size = win.max_size(); - if min_size.w != 0 && min_size.w == max_size.w { - size.w = min_size.w; - } - if min_size.h != 0 && min_size.h == max_size.h { - size.h = min_size.h; - } + size.w = ensure_min_max_size_maybe_zero(size.w, min_size.w, max_size.w); + size.h = ensure_min_max_size_maybe_zero(size.h, min_size.h, max_size.h); + win.request_size_once(size, true); if activate || self.tiles.is_empty() { |
