From dd19b8d2c20a8bdeb2064683cbfce55cf5e1dd82 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 12 Aug 2025 11:44:20 +0200 Subject: [PATCH] REVIEWED: Requested window flags application after window initialization --- src/platforms/rcore_desktop_glfw.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index 87874897c..36ea830b9 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -1363,8 +1363,9 @@ int InitPlatform(void) // additionally auto iconify restores the hardware resolution of the monitor if the window that loses focus is a fullscreen window glfwWindowHint(GLFW_AUTO_ICONIFY, 0); - // Keep flags to restore after initialization (for flags not supported on initialization) - unsigned int originalCoreWindowFlags = CORE.Window.flags; + // Window flags requested before initialization to be applied after initialization + unsigned int requetedWindowFlags = CORE.Window.flags; + // Check window creation flags if ((CORE.Window.flags & FLAG_FULLSCREEN_MODE) > 0) CORE.Window.fullscreen = true; @@ -1674,6 +1675,9 @@ int InitPlatform(void) CORE.Window.position.x = posX; CORE.Window.position.y = posY; } + + // Apply window flags requested previous to initialization + SetWindowState(requetedWindowFlags); // Load OpenGL extensions // NOTE: GL procedures address loader is required to load extensions @@ -1727,15 +1731,12 @@ int InitPlatform(void) #if defined(__NetBSD__) // Workaround for NetBSD - char *glfwPlatform = "X11"; + char *glfwPlatform = "X11 (NetBSD)"; #else char *glfwPlatform = ""; switch (glfwGetPlatform()) { - case GLFW_PLATFORM_WIN32: - glfwPlatform = "Win32"; - SetWindowState(originalCoreWindowFlags); - break; + case GLFW_PLATFORM_WIN32: glfwPlatform = "Win32"; break; case GLFW_PLATFORM_COCOA: glfwPlatform = "Cocoa"; break; case GLFW_PLATFORM_WAYLAND: glfwPlatform = "Wayland"; break; case GLFW_PLATFORM_X11: glfwPlatform = "X11"; break;