WinRT: made bug 3202/3213's fix apply for WinRT apps
authorDavid Ludwig <dludwig@pobox.com>
Sun, 27 Dec 2015 22:26:27 -0500
changeset 9971 fa7c016ac2d3
parent 9970 41d6973a250f
child 9972 734c90ea9990
WinRT: made bug 3202/3213's fix apply for WinRT apps
src/core/winrt/SDL_winrtapp_direct3d.cpp
--- a/src/core/winrt/SDL_winrtapp_direct3d.cpp	Sun Dec 27 18:56:46 2015 -0500
+++ b/src/core/winrt/SDL_winrtapp_direct3d.cpp	Sun Dec 27 22:26:27 2015 -0500
@@ -218,7 +218,17 @@
             }
 #endif
 
-            WINRT_UpdateWindowFlags(window, SDL_WINDOW_MAXIMIZED | SDL_WINDOW_FULLSCREEN_DESKTOP);
+            const Uint32 latestFlags = WINRT_DetectWindowFlags(window);
+            if (latestFlags & SDL_WINDOW_MAXIMIZED) {
+                /* SDL_SendWindowEvent, as of this writing (2015-Dec-27), *won't* actually
+                   send events if the associated flag is already set.  This is taken
+                   advantage of here.  The below call is only meant to send a
+                   window event, if and when it is needed!
+                */
+                SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MAXIMIZED, 0, 0);
+            }
+
+            WINRT_UpdateWindowFlags(window, SDL_WINDOW_FULLSCREEN_DESKTOP);
 
             /* The window can move during a resize event, such as when maximizing
                or resizing from a corner */