Skip to content

Commit 195b968

Browse files
authored
Merge pull request #4837 from Andersama/support_all_window_flags_at_initialization
[rcore] Support window flags with initialization issues
2 parents 95e4494 + 99a9ecf commit 195b968

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/platforms/rcore_desktop_glfw.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1363,6 +1363,8 @@ int InitPlatform(void)
13631363
// additionally auto iconify restores the hardware resolution of the monitor if the window that loses focus is a fullscreen window
13641364
glfwWindowHint(GLFW_AUTO_ICONIFY, 0);
13651365

1366+
// Keep flags to restore after initialization (for flags not supported on initialization)
1367+
unsigned int originalCoreWindowFlags = CORE.Window.flags;
13661368
// Check window creation flags
13671369
if ((CORE.Window.flags & FLAG_FULLSCREEN_MODE) > 0) CORE.Window.fullscreen = true;
13681370

@@ -1730,7 +1732,10 @@ int InitPlatform(void)
17301732
char *glfwPlatform = "";
17311733
switch (glfwGetPlatform())
17321734
{
1733-
case GLFW_PLATFORM_WIN32: glfwPlatform = "Win32"; break;
1735+
case GLFW_PLATFORM_WIN32:
1736+
glfwPlatform = "Win32";
1737+
SetWindowState(originalCoreWindowFlags);
1738+
break;
17341739
case GLFW_PLATFORM_COCOA: glfwPlatform = "Cocoa"; break;
17351740
case GLFW_PLATFORM_WAYLAND: glfwPlatform = "Wayland"; break;
17361741
case GLFW_PLATFORM_X11: glfwPlatform = "X11"; break;

0 commit comments

Comments
 (0)