mirror of
https://github.com/reactos/reactos.git
synced 2024-09-30 14:37:45 +00:00
[NTUSER][USER32] Workaround tracking menu on CORE-17338 (#4048)
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. I do intend to port it back nevertheless.
This commit is contained in:
parent
fdb4205061
commit
6417b2323d
|
@ -4118,7 +4118,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.
|
||||||
|
|
|
@ -338,8 +338,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