1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-25 22:33:52 +03:00

macos: correctly synthesize WindowState::MAXIMIZED

This commit is contained in:
Wez Furlong 2023-03-31 22:06:22 -07:00
parent a278dbf43f
commit 8b03890b8b
No known key found for this signature in database
GPG Key ID: 7A7F66A31EC9B387

View File

@ -2710,6 +2710,12 @@ impl WindowView {
let live_resizing = inner.live_resizing; 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 { inner.events.dispatch(WindowEvent::Resized {
dimensions: Dimensions { dimensions: Dimensions {
pixel_width: width as usize, pixel_width: width as usize,
@ -2719,6 +2725,8 @@ impl WindowView {
}, },
window_state: if is_full_screen { window_state: if is_full_screen {
WindowState::FULL_SCREEN WindowState::FULL_SCREEN
} else if is_zoomed {
WindowState::MAXIMIZED
} else { } else {
WindowState::default() WindowState::default()
}, },