From e959e4f1ace6122d447a704ea85c2b30f8afa7d7 Mon Sep 17 00:00:00 2001 From: Victoria Brekenfeld Date: Mon, 11 Mar 2024 16:18:49 +0100 Subject: [PATCH] tiling: Fix flickering on overview (fix #345) --- src/shell/layout/tiling/mod.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/shell/layout/tiling/mod.rs b/src/shell/layout/tiling/mod.rs index af3361ca..012f41b5 100644 --- a/src/shell/layout/tiling/mod.rs +++ b/src/shell/layout/tiling/mod.rs @@ -5257,10 +5257,12 @@ where ) } - let behavior = if animating { - ConstrainScaleBehavior::Stretch + let (behavior, align) = if is_overview { + (ConstrainScaleBehavior::Fit, ConstrainAlign::CENTER) + } else if animating { + (ConstrainScaleBehavior::Stretch, ConstrainAlign::TOP_LEFT) } else { - ConstrainScaleBehavior::CutOff + (ConstrainScaleBehavior::CutOff, ConstrainAlign::TOP_LEFT) }; let w_elements = w_elements.into_iter().flat_map(|element| match element { @@ -5271,7 +5273,7 @@ where geo.as_logical().to_physical_precise_round(output_scale), elem_geometry, behavior, - ConstrainAlign::TOP_LEFT, + align, output_scale, ) .next() @@ -5283,7 +5285,7 @@ where geo.as_logical().to_physical_precise_round(output_scale), elem_geometry, behavior, - ConstrainAlign::TOP_LEFT, + align, output_scale, ) .next() @@ -5295,7 +5297,7 @@ where geo.as_logical().to_physical_precise_round(output_scale), elem_geometry, behavior, - ConstrainAlign::TOP_LEFT, + align, output_scale, ) .next()