user32: Don't check active window state when handling SC_MINIMIZE/SC_MAXIMIZE/SC_RESTORE.

An application I'm working on routes messages to a worker thread, and checking
for an active window while processing WM_SYSCOMMAND in that thread breaks things.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Dmitry Timoshkov 2021-10-13 13:26:43 +03:00 committed by Alexandre Julliard
parent b440573d2a
commit 51d606faac

View File

@ -1560,19 +1560,18 @@ LRESULT NC_HandleSysCommand( HWND hwnd, WPARAM wParam, LPARAM lParam )
break;
case SC_MINIMIZE:
if (hwnd == GetActiveWindow())
ShowOwnedPopups(hwnd,FALSE);
ShowOwnedPopups(hwnd,FALSE);
ShowWindow( hwnd, SW_MINIMIZE );
break;
case SC_MAXIMIZE:
if (IsIconic(hwnd) && hwnd == GetActiveWindow())
if (IsIconic(hwnd))
ShowOwnedPopups(hwnd,TRUE);
ShowWindow( hwnd, SW_MAXIMIZE );
break;
case SC_RESTORE:
if (IsIconic(hwnd) && hwnd == GetActiveWindow())
if (IsIconic(hwnd))
ShowOwnedPopups(hwnd,TRUE);
ShowWindow( hwnd, SW_RESTORE );
break;