From 9ecfa8bfda26c1646adddf39949db0b6ec58c090 Mon Sep 17 00:00:00 2001 From: Victoria Brekenfeld Date: Thu, 7 Dec 2023 19:43:11 +0000 Subject: [PATCH] floating: Fix initial size for previously maximized --- src/shell/layout/floating/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/shell/layout/floating/mod.rs b/src/shell/layout/floating/mod.rs index 45182f6e..56311c70 100644 --- a/src/shell/layout/floating/mod.rs +++ b/src/shell/layout/floating/mod.rs @@ -240,8 +240,8 @@ impl FloatingLayout { .into(), ); - // if the last_geometry is too large - if win_geo.size.w > output_geometry.size.w { + // if the current geometry is too large + if win_geo.size.w > max_size.w { // try a more reasonable size let mut width = output_geometry.size.w / 3 * 2; if max_size.w != 0 { @@ -255,7 +255,7 @@ 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, output_geometry.size.w); } - if win_geo.size.h > output_geometry.size.h { + if win_geo.size.h > max_size.h { // try a more reasonable size let mut height = output_geometry.size.h / 3 * 2; if max_size.h != 0 { @@ -424,7 +424,7 @@ impl FloatingLayout { window.configure(); } } - } else if !window.is_maximized(true) || !window.is_fullscreen(true) { + } else if !window.is_maximized(true) && !window.is_fullscreen(true) { if let Some(location) = self.space.element_location(window) { *window.last_geometry.lock().unwrap() = Some( Rectangle::from_loc_and_size(