@@ -328,6 +328,8 @@ void MaximizeWindow(void)
328
328
const int tabHeight = EM_ASM_INT ( { return window .innerHeight ; }, 0 );
329
329
330
330
if (tabWidth && tabHeight ) glfwSetWindowSize (platform .handle , tabWidth , tabHeight );
331
+
332
+ CORE .Window .flags |= FLAG_WINDOW_MAXIMIZED ;
331
333
}
332
334
}
333
335
@@ -343,6 +345,8 @@ void RestoreWindow(void)
343
345
if (glfwGetWindowAttrib (platform .handle , GLFW_RESIZABLE ) == GLFW_TRUE )
344
346
{
345
347
if (platform .unmaximizedWidth && platform .unmaximizedHeight ) glfwSetWindowSize (platform .handle , platform .unmaximizedWidth , platform .unmaximizedHeight );
348
+
349
+ CORE .Window .flags &= ~FLAG_WINDOW_MAXIMIZED ;
346
350
}
347
351
}
348
352
@@ -412,9 +416,20 @@ void SetWindowState(unsigned int flags)
412
416
}
413
417
414
418
// State change: FLAG_WINDOW_MAXIMIZED
415
- if ((flags & FLAG_WINDOW_MAXIMIZED ) > 0 )
419
+ if ((( CORE . Window . flags & FLAG_WINDOW_MAXIMIZED ) != ( flags & FLAG_WINDOW_MAXIMIZED )) && (( flags & FLAG_WINDOW_MAXIMIZED ) > 0 ) )
416
420
{
417
- TRACELOG (LOG_WARNING , "SetWindowState(FLAG_WINDOW_MAXIMIZED) not available on target platform" );
421
+ if (glfwGetWindowAttrib (platform .handle , GLFW_RESIZABLE ) == GLFW_TRUE )
422
+ {
423
+ platform .unmaximizedWidth = CORE .Window .screen .width ;
424
+ platform .unmaximizedHeight = CORE .Window .screen .height ;
425
+
426
+ const int tabWidth = EM_ASM_INT ( { return window .innerWidth ; }, 0 );
427
+ const int tabHeight = EM_ASM_INT ( { return window .innerHeight ; }, 0 );
428
+
429
+ if (tabWidth && tabHeight ) glfwSetWindowSize (platform .handle , tabWidth , tabHeight );
430
+
431
+ CORE .Window .flags |= FLAG_WINDOW_MAXIMIZED ;
432
+ }
418
433
}
419
434
420
435
// State change: FLAG_WINDOW_UNFOCUSED
@@ -530,9 +545,14 @@ void ClearWindowState(unsigned int flags)
530
545
}
531
546
532
547
// State change: FLAG_WINDOW_MAXIMIZED
533
- if ((flags & FLAG_WINDOW_MAXIMIZED ) > 0 )
548
+ if ((( CORE . Window . flags & FLAG_WINDOW_MAXIMIZED ) > 0 ) && (( flags & FLAG_WINDOW_MAXIMIZED ) > 0 ) )
534
549
{
535
- TRACELOG (LOG_WARNING , "ClearWindowState(FLAG_WINDOW_MAXIMIZED) not available on target platform" );
550
+ if (glfwGetWindowAttrib (platform .handle , GLFW_RESIZABLE ) == GLFW_TRUE )
551
+ {
552
+ if (platform .unmaximizedWidth && platform .unmaximizedHeight ) glfwSetWindowSize (platform .handle , platform .unmaximizedWidth , platform .unmaximizedHeight );
553
+
554
+ CORE .Window .flags &= ~FLAG_WINDOW_MAXIMIZED ;
555
+ }
536
556
}
537
557
538
558
// State change: FLAG_WINDOW_UNDECORATED
0 commit comments