Commit 399df540e3ec946b65ac899d741e8193c8c56105

Ryan C. Gordon 2019-06-11T01:14:24

windows: Drop WM_ACTIVATE when window is hidden, but only if being activated. Fixes Bugzilla #4571.

diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c
index 73b2185..e3eaf8f 100644
--- a/src/video/windows/SDL_windowsevents.c
+++ b/src/video/windows/SDL_windowsevents.c
@@ -428,13 +428,12 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
             POINT cursorPos;
             BOOL minimized;
 
-            /* Don't mark the window as shown if it's activated before being shown */
-            if (!IsWindowVisible(hwnd)) {
-                break;
-            }
-
             minimized = HIWORD(wParam);
             if (!minimized && (LOWORD(wParam) != WA_INACTIVE)) {
+                /* Don't mark the window as shown if it's activated before being shown */
+                if (!IsWindowVisible(hwnd)) {
+                    break;
+                }
                 if (LOWORD(wParam) == WA_CLICKACTIVE) {
                     if (GetAsyncKeyState(VK_LBUTTON)) {
                         data->focus_click_pending |= SDL_BUTTON_LMASK;