[WIN32SS:NTUSER] Fix window state after restoring snapped window (#4119)
authorDenis Malikov <Getequ@users.noreply.github.com>
Tue, 23 Nov 2021 22:34:03 +0000 (05:34 +0700)
committerGitHub <noreply@github.com>
Tue, 23 Nov 2021 22:34:03 +0000 (23:34 +0100)
InternalPos.NormalRect is a key data for detecting whether a window was snapped.
Keeping it after restore affecting next snap actions.

CORE-16477

win32ss/user/ntuser/defwnd.c

index ea6adc7..846a131 100644 (file)
@@ -815,9 +815,16 @@ IntDefWindowProc(
                if (wParam == VK_DOWN)
                {
                    if (topWnd->style & WS_MAXIMIZE)
+                   {
                        co_IntSendMessage(hwndTop, WM_SYSCOMMAND, SC_RESTORE, lParam);
+
+                       /* "Normal size" must be erased after restoring, otherwise it will block next side snap actions */
+                       RECTL_vSetEmptyRect(&topWnd->InternalPos.NormalRect);
+                   }
                    else
+                   {
                        co_IntSendMessage(hwndTop, WM_SYSCOMMAND, SC_MINIMIZE, lParam);
+                   }
                }
                else if (wParam == VK_UP)
                {