[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 e6bced7a35.

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
This commit is contained in:
Carl J. Bialorucki 2023-07-26 15:26:42 -06:00 committed by GitHub
parent 8f3a09722e
commit 4511e62b10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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");
}