forge
Explore
Log in

Don't you dare go Hollow

layout: Use new helper function

Browse files at this commit

99c0fabee658d3b1fc0fd3faf6741afd344d8dabIvan MolodetskikhParent: fc99724
src/layout/workspace.rsmodified+5 -4
@@ -25,7 +25,10 @@ use crate::render_helpers::renderer::NiriRenderer;
25 use crate::render_helpers::RenderTarget;25 use crate::render_helpers::RenderTarget;
26 use crate::utils::id::IdCounter;26 use crate::utils::id::IdCounter;
27 use crate::utils::transaction::{Transaction, TransactionBlocker};27 use crate::utils::transaction::{Transaction, TransactionBlocker};
28-use crate::utils::{ensure_min_max_size, output_size, send_scale_transform, ResizeEdge};28+use crate::utils::{
29+ ensure_min_max_size, ensure_min_max_size_maybe_zero, output_size, send_scale_transform,
30+ ResizeEdge,
31+};
29 use crate::window::ResolvedWindowRules;32 use crate::window::ResolvedWindowRules;
30 33
31 #[derive(Debug)]34 #[derive(Debug)]
@@ -729,9 +732,7 @@ impl<W: LayoutElement> Workspace<W> {
729 // size. This is to ensure that a fixed-size window rule works on open, while still732 // size. This is to ensure that a fixed-size window rule works on open, while still
730 // allowing the window freedom to pick its default size otherwise.733 // allowing the window freedom to pick its default size otherwise.
731 let (min_size, max_size) = rules.apply_min_max_size(min_size, max_size);734 let (min_size, max_size) = rules.apply_min_max_size(min_size, max_size);
732- if size.w > 0 || min_size.w == max_size.w {735+ size.w = ensure_min_max_size_maybe_zero(size.w, min_size.w, max_size.w);
733- size.w = ensure_min_max_size(size.w, min_size.w, max_size.w);
734- }
735 // For scrolling (where height is > 0) only ensure fixed height, since at runtime scrolling736 // For scrolling (where height is > 0) only ensure fixed height, since at runtime scrolling
736 // will only honor fixed height currently.737 // will only honor fixed height currently.
737 if min_size.h == max_size.h {738 if min_size.h == max_size.h {