From 4511e62b10861b556b81e4f8b0bb922cb97d25a7 Mon Sep 17 00:00:00 2001 From: "Carl J. Bialorucki" Date: Wed, 26 Jul 2023 15:26:42 -0600 Subject: [PATCH] [EXPLORER] Restore minimized windows with the correct position (#5488) Stop storing and setting window positions from the taskbar and rely on the window's existing position instead. Partial revert of e6bced7a353. Windows are now correctly positioned when being restored from the taskbar. This also fixes an issue where minimizing and opening Task Manager causes the window to become blank when running our shell in Windows Server 2003. CORE-19055 CORE-13895 CORE-18350 --- base/shell/explorer/taskswnd.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/base/shell/explorer/taskswnd.cpp b/base/shell/explorer/taskswnd.cpp index e58c99bc6df..abe3f10ae47 100644 --- a/base/shell/explorer/taskswnd.cpp +++ b/base/shell/explorer/taskswnd.cpp @@ -82,7 +82,6 @@ typedef struct _TASK_ITEM PTASK_GROUP Group; INT Index; INT IconIndex; - WINDOWPLACEMENT wndpl; union { @@ -1113,8 +1112,6 @@ public: TaskItem->hWnd = hWnd; TaskItem->Index = -1; TaskItem->Group = AddToTaskGroup(hWnd); - TaskItem->wndpl.length = sizeof(TaskItem->wndpl); - ::GetWindowPlacement(hWnd, &TaskItem->wndpl); if (!m_IsDestroying) { @@ -1602,16 +1599,12 @@ public: if (!bIsMinimized && bIsActive) { - TaskItem->wndpl.length = sizeof(TaskItem->wndpl); - ::GetWindowPlacement(TaskItem->hWnd, &TaskItem->wndpl); - ::ShowWindowAsync(TaskItem->hWnd, SW_MINIMIZE); TRACE("Valid button clicked. App window Minimized.\n"); } else { ::SwitchToThisWindow(TaskItem->hWnd, TRUE); - ::SetWindowPlacement(TaskItem->hWnd, &TaskItem->wndpl); TRACE("Valid button clicked. App window Restored.\n"); }