mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[0.4.11][NTUSER][USER32] Tracking menu CORE-17338 (#4048), [EXPLORER] Send WM_POPUPSYSTEMMENU asynchronously (#4047) CORE-16353
This prevents the tracking menu from erroneously closing itself right after it was opened in some cases. Fixes CORE-17338 which got unhidden by 0.4.15-dev-1126-g58b0558f94
And fixes CORE-15760 which got unhidden by SVN r74972 == git19dd22d422
Since both symptoms look very similar but the unhiding revisions did differ, that could mean we do have some kind of race condition here. I guess this fix is more like a workaround. 2 Fixes picked: 0.4.15-dev-3313-g6417b2323d
[NTUSER][USER32] Workaround tracking menu on CORE-17338 CORE-15760 (#4048) to prevent the menu from auto-closing and 0.4.15-dev-3297-g037c744eb1
[EXPLORER] Send WM_POPUPSYSTEMMENU asynchronously CORE-16353 (#4047) to make the taskbar button turn into pressed state when the menu opens
This commit is contained in:
parent
cbe7a5fd14
commit
e0702653a5
3 changed files with 14 additions and 2 deletions
|
@ -1623,6 +1623,11 @@ public:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static VOID CALLBACK
|
||||||
|
SendAsyncProc(HWND hwnd, UINT uMsg, DWORD_PTR dwData, LRESULT lResult)
|
||||||
|
{
|
||||||
|
::PostMessageW(hwnd, WM_NULL, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
VOID HandleTaskItemRightClick(IN OUT PTASK_ITEM TaskItem)
|
VOID HandleTaskItemRightClick(IN OUT PTASK_ITEM TaskItem)
|
||||||
{
|
{
|
||||||
|
@ -1633,7 +1638,11 @@ public:
|
||||||
|
|
||||||
ActivateTask(TaskItem->hWnd);
|
ActivateTask(TaskItem->hWnd);
|
||||||
|
|
||||||
::SendMessageW(TaskItem->hWnd, WM_POPUPSYSTEMMENU, 0, MAKELPARAM(pt.x, pt.y));
|
if (GetForegroundWindow() != TaskItem->hWnd)
|
||||||
|
ERR("HandleTaskItemRightClick detected the window did not become foreground\n");
|
||||||
|
|
||||||
|
::SendMessageCallbackW(TaskItem->hWnd, WM_POPUPSYSTEMMENU, 0, MAKELPARAM(pt.x, pt.y),
|
||||||
|
SendAsyncProc, (ULONG_PTR)TaskItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID HandleTaskGroupRightClick(IN OUT PTASK_GROUP TaskGroup)
|
VOID HandleTaskGroupRightClick(IN OUT PTASK_GROUP TaskGroup)
|
||||||
|
|
|
@ -4121,7 +4121,7 @@ static INT FASTCALL MENU_TrackMenu(PMENU pmenu, UINT wFlags, INT x, INT y,
|
||||||
/* ReactOS Checks */
|
/* ReactOS Checks */
|
||||||
if (!VerifyWnd(mt.OwnerWnd) ||
|
if (!VerifyWnd(mt.OwnerWnd) ||
|
||||||
!ValidateHwndNoErr(mt.CurrentMenu->hWnd) ||
|
!ValidateHwndNoErr(mt.CurrentMenu->hWnd) ||
|
||||||
pti->MessageQueue->QF_flags & QF_ACTIVATIONCHANGE ||
|
//pti->MessageQueue->QF_flags & QF_ACTIVATIONCHANGE || // See CORE-17338
|
||||||
capture_win != IntGetCapture() ) // Should not happen, but this is ReactOS...
|
capture_win != IntGetCapture() ) // Should not happen, but this is ReactOS...
|
||||||
{
|
{
|
||||||
ErrorExit = TRUE; // Do not wait on dead windows, now win test_capture_4 works.
|
ErrorExit = TRUE; // Do not wait on dead windows, now win test_capture_4 works.
|
||||||
|
|
|
@ -335,8 +335,11 @@ User32DefWindowProc(HWND hWnd,
|
||||||
HMENU menu = GetSystemMenu(hWnd, FALSE);
|
HMENU menu = GetSystemMenu(hWnd, FALSE);
|
||||||
ERR("WM_POPUPSYSTEMMENU\n");
|
ERR("WM_POPUPSYSTEMMENU\n");
|
||||||
if (menu)
|
if (menu)
|
||||||
|
{
|
||||||
|
SetForegroundWindow(hWnd);
|
||||||
TrackPopupMenu(menu, TPM_LEFTBUTTON|TPM_RIGHTBUTTON|TPM_SYSTEM_MENU,
|
TrackPopupMenu(menu, TPM_LEFTBUTTON|TPM_RIGHTBUTTON|TPM_SYSTEM_MENU,
|
||||||
LOWORD(lParam), HIWORD(lParam), 0, hWnd, NULL);
|
LOWORD(lParam), HIWORD(lParam), 0, hWnd, NULL);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue