[EXPLORER] Check IsHungAppWindow before minimizing (#7080)

Reduce system freezing on Win+D.
Normal minimizing causes message
transfer. If the window was hanging,
then it fell into endless message loop.
JIRA issue: CORE-19673
This commit is contained in:
Katayama Hirofumi MZ 2024-07-07 06:50:46 +09:00 committed by GitHub
parent 0cfd7bde9b
commit 92551f540c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -1601,7 +1601,8 @@ public:
if (!bIsMinimized && bIsActive)
{
::ShowWindowAsync(TaskItem->hWnd, SW_MINIMIZE);
if (!::IsHungAppWindow(TaskItem->hWnd))
::ShowWindowAsync(TaskItem->hWnd, SW_MINIMIZE);
TRACE("Valid button clicked. App window Minimized.\n");
}
else

View file

@ -101,7 +101,8 @@ VOID RestoreWindowPos()
BOOL CanBeMinimized(HWND hwnd)
{
if (::IsWindowVisible(hwnd) && !::IsIconic(hwnd) && ::IsWindowEnabled(hwnd))
if (::IsWindowVisible(hwnd) && !::IsIconic(hwnd) && ::IsWindowEnabled(hwnd) &&
!::IsHungAppWindow(hwnd))
{
if (::GetClassLongPtrW(hwnd, GCW_ATOM) == (ULONG_PTR)WC_DIALOG)
return TRUE;