From 045333e8904a0eebc8bbf0416df5121e53fc5023 Mon Sep 17 00:00:00 2001 From: Jose Carlos Jesus Date: Fri, 2 Aug 2024 15:36:26 +0100 Subject: [PATCH] [EXPLORER] Restore windows on second click of Show Desktop button (#7184) On the second click on "Show desktop" button, the minimized windows are not restored, because after the first click, and the addition to `CSimpleArray g_MinimizedAll`, a call to `RestoreMinimizedNonTaskWnds()` via `HSHELL_WINDOWACTIVATED` message clears the list of minimized windows. Don't empty `g_MinimizedAll` while processing HSHELL_WINDOWCREATED or HSHELL_WINDOWACTIVATED messages (bDestroyed=FALSE). Empty `g_MinimizedAll` only when SendPulseToTray is called with bDestroyed=TRUE. Addendum to e6bced7a353 and 70d7009ad95. CORE-19703 CORE-15369 --- base/shell/explorer/traywnd.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/base/shell/explorer/traywnd.cpp b/base/shell/explorer/traywnd.cpp index a2d49f8010d..868447796fc 100644 --- a/base/shell/explorer/traywnd.cpp +++ b/base/shell/explorer/traywnd.cpp @@ -3049,9 +3049,9 @@ HandleTrayContextMenu: } } - g_MinimizedAll.RemoveAll(); - - if (!bDestroyed) + if (bDestroyed) + g_MinimizedAll.RemoveAll(); + else ::SetForegroundWindow(hwndActive); }