diff --git a/src/application.rs b/src/application.rs index e735218b53..efe932bffe 100644 --- a/src/application.rs +++ b/src/application.rs @@ -256,9 +256,26 @@ impl Application

{ /// Sets the [`window::Settings::size`] of the [`Application`]. pub fn window_size(self, size: impl Into) -> Self { + #[cfg(not(target_os = "macos"))] + let size = size.into(); + + // https://developer.apple.com/documentation/appkit/nswindow/init(contentrect:stylemask:backing:defer:)#parameters + #[cfg(target_os = "macos")] + let mut size = size.into(); + + #[cfg(target_os = "macos")] + { + if size.height > 10_000. { + size.height = 10_000.; + } + if size.width > 10_000. { + size.width = 10_000.; + } + } + Self { window: window::Settings { - size: size.into(), + size, ..self.window }, ..self