https://git.reactos.org/?p=reactos.git;a=commitdiff;h=045333e8904a0eebc8bbf…
commit 045333e8904a0eebc8bbf0416df5121e53fc5023
Author: Jose Carlos Jesus <zecarlos1957(a)hotmail.com>
AuthorDate: Fri Aug 2 15:36:26 2024 +0100
Commit: GitHub <noreply(a)github.com>
CommitDate: Fri Aug 2 17:36:26 2024 +0300
[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<MINWNDPOS> 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);
}