From 12067d8b30a7c0948fdfea28338cea5d65570ae2 Mon Sep 17 00:00:00 2001 From: PixelDots Date: Fri, 6 Oct 2023 11:34:14 -0500 Subject: [PATCH] Fix windows resizing after being moved revert `457b000e682bd00ed62c28023107b0dc71d57ae0` --- src/shell/layout/floating/mod.rs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/shell/layout/floating/mod.rs b/src/shell/layout/floating/mod.rs index f3d708a3..8595ea9b 100644 --- a/src/shell/layout/floating/mod.rs +++ b/src/shell/layout/floating/mod.rs @@ -104,18 +104,14 @@ impl FloatingLayout { if let Some(size) = last_geometry.map(|g| g.size) { win_geo.size = size; - } - { + } else { let (min_size, max_size) = ( mapped.min_size().unwrap_or((0, 0).into()), mapped.max_size().unwrap_or((0, 0).into()), ); - if win_geo.size.w > max_size.w - || win_geo.size.w < min_size.w - || win_geo.size.w > geometry.size.w - { + if win_geo.size.w > geometry.size.w / 3 * 2 { // try a more reasonable size - let mut width = win_geo.size.w; + let mut width = geometry.size.w / 3 * 2; if max_size.w != 0 { // don't go larger then the max_size ... width = std::cmp::min(max_size.w, width); @@ -127,12 +123,9 @@ impl FloatingLayout { // but no matter the supported sizes, don't be larger than our non-exclusive-zone win_geo.size.w = std::cmp::min(width, geometry.size.w); } - if win_geo.size.h > max_size.h - || win_geo.size.h < min_size.h - || win_geo.size.h > geometry.size.h - { + if win_geo.size.h > geometry.size.h / 3 * 2 { // try a more reasonable size - let mut height = win_geo.size.h; + let mut height = geometry.size.h / 3 * 2; if max_size.h != 0 { // don't go larger then the max_size ... height = std::cmp::min(max_size.h, height);