From 8b03890b8b5ad6d936d13ee71c6b12157399b89f Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Fri, 31 Mar 2023 22:06:22 -0700 Subject: [PATCH] macos: correctly synthesize WindowState::MAXIMIZED --- window/src/os/macos/window.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/window/src/os/macos/window.rs b/window/src/os/macos/window.rs index a15a64d27..2a51bf809 100644 --- a/window/src/os/macos/window.rs +++ b/window/src/os/macos/window.rs @@ -2710,6 +2710,12 @@ impl WindowView { let live_resizing = inner.live_resizing; + let is_zoomed = !is_full_screen + && inner.window.as_ref().map_or(false, |window| { + let window = window.load(); + unsafe { msg_send![*window, isZoomed] } + }); + inner.events.dispatch(WindowEvent::Resized { dimensions: Dimensions { pixel_width: width as usize, @@ -2719,6 +2725,8 @@ impl WindowView { }, window_state: if is_full_screen { WindowState::FULL_SCREEN + } else if is_zoomed { + WindowState::MAXIMIZED } else { WindowState::default() },