From cba8f4286d5b42ed5e999ba543ca6ebb22d99572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louka=20M=C3=A9nard=20Blondin?= Date: Sat, 11 Jul 2026 03:06:54 -0700 Subject: [PATCH] Fix initial macOS window size (#5967) --- src/platforms/rcore_desktop_glfw.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index 6fd5096f8..f1bf0ae8e 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -1693,6 +1693,14 @@ int InitPlatform(void) return -1; } +#if defined(__APPLE__) + // AppKit can constrain the requested window size to the visible work area during creation + int windowWidth = 0; + int windowHeight = 0; + glfwGetWindowSize(platform.handle, &windowWidth, &windowHeight); + if ((windowWidth > 0) && (windowHeight > 0)) CORE.Window.screen = (Size){ windowWidth, windowHeight }; +#endif + // NOTE: Not considering scale factor now, considered below CORE.Window.render.width = CORE.Window.screen.width; CORE.Window.render.height = CORE.Window.screen.height;