[WIN32SS][NTUSER] Fix hit test position of popup menu

The submenu of desktop popup menu was erroneously shown at first right click.
- Fix the hit test position that was modified by window style change.
CORE-16382
This commit is contained in:
Katayama Hirofumi MZ 2019-09-21 18:21:17 +09:00 committed by GitHub
parent dff75d7162
commit 81e27f0be7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1480,11 +1480,16 @@ MENU_AdjustMenuItemRect(PMENU menu, PRECTL rect)
static ITEM *MENU_FindItemByCoords( MENU *menu, POINT pt, UINT *pos )
{
ITEM *item;
UINT i;
UINT i, cx, cy;
RECT rect;
PWND pWnd = ValidateHwndNoErr(menu->hWnd);
if (!IntGetWindowRect(pWnd, &rect)) return NULL;
cx = UserGetSystemMetrics(SM_CXDLGFRAME);
cy = UserGetSystemMetrics(SM_CYDLGFRAME);
RECTL_vInflateRect(&rect, -cx, -cy);
if (pWnd->ExStyle & WS_EX_LAYOUTRTL)
pt.x = rect.right - 1 - pt.x;
else