Skip to content

Commit cb21fe8

Browse files
author
Asdqwe
authored
Fix MaximizeWindow() for PLATFORM_WEB (#4404)
1 parent 4290a0d commit cb21fe8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/platforms/rcore_web.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ void ToggleBorderlessWindowed(void)
319319
// Set window state: maximized, if resizable
320320
void MaximizeWindow(void)
321321
{
322-
if (glfwGetWindowAttrib(platform.handle, GLFW_RESIZABLE) == GLFW_TRUE)
322+
if (glfwGetWindowAttrib(platform.handle, GLFW_RESIZABLE) == GLFW_TRUE && !(CORE.Window.flags & FLAG_WINDOW_MAXIMIZED))
323323
{
324324
platform.unmaximizedWidth = CORE.Window.screen.width;
325325
platform.unmaximizedHeight = CORE.Window.screen.height;
@@ -342,7 +342,7 @@ void MinimizeWindow(void)
342342
// Set window state: not minimized/maximized
343343
void RestoreWindow(void)
344344
{
345-
if (glfwGetWindowAttrib(platform.handle, GLFW_RESIZABLE) == GLFW_TRUE)
345+
if (glfwGetWindowAttrib(platform.handle, GLFW_RESIZABLE) == GLFW_TRUE && (CORE.Window.flags & FLAG_WINDOW_MAXIMIZED))
346346
{
347347
if (platform.unmaximizedWidth && platform.unmaximizedHeight) glfwSetWindowSize(platform.handle, platform.unmaximizedWidth, platform.unmaximizedHeight);
348348

0 commit comments

Comments
 (0)