Update MaximizeWindow() and RestoreWindow() to set/unset the FLAG_WINDOW_MAXIMIZED

This commit is contained in:
asdqwe 2024-10-20 19:58:42 -03:00
parent cf5854f919
commit d277c9d6de

View File

@ -328,6 +328,8 @@ void MaximizeWindow(void)
const int tabHeight = EM_ASM_INT( { return window.innerHeight; }, 0); const int tabHeight = EM_ASM_INT( { return window.innerHeight; }, 0);
if (tabWidth && tabHeight) glfwSetWindowSize(platform.handle, tabWidth, tabHeight); if (tabWidth && tabHeight) glfwSetWindowSize(platform.handle, tabWidth, tabHeight);
CORE.Window.flags |= FLAG_WINDOW_MAXIMIZED;
} }
} }
@ -343,6 +345,8 @@ void RestoreWindow(void)
if (glfwGetWindowAttrib(platform.handle, GLFW_RESIZABLE) == GLFW_TRUE) if (glfwGetWindowAttrib(platform.handle, GLFW_RESIZABLE) == GLFW_TRUE)
{ {
if (platform.unmaximizedWidth && platform.unmaximizedHeight) glfwSetWindowSize(platform.handle, platform.unmaximizedWidth, platform.unmaximizedHeight); if (platform.unmaximizedWidth && platform.unmaximizedHeight) glfwSetWindowSize(platform.handle, platform.unmaximizedWidth, platform.unmaximizedHeight);
CORE.Window.flags &= ~FLAG_WINDOW_MAXIMIZED;
} }
} }