From fa7c15ce1f4c83ab82fff34e4b68c7712a6f8fcd Mon Sep 17 00:00:00 2001 From: David Ludwig Date: Sun, 27 Dec 2015 22:26:27 -0500 Subject: [PATCH] WinRT: made bug 3202/3213's fix apply for WinRT apps --- src/core/winrt/SDL_winrtapp_direct3d.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/core/winrt/SDL_winrtapp_direct3d.cpp b/src/core/winrt/SDL_winrtapp_direct3d.cpp index 3ae134bd8..87439a111 100644 --- a/src/core/winrt/SDL_winrtapp_direct3d.cpp +++ b/src/core/winrt/SDL_winrtapp_direct3d.cpp @@ -218,7 +218,17 @@ WINRT_ProcessWindowSizeChange() // TODO: Pass an SDL_Window-identifying thing in } #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 */