https://git.reactos.org/?p=reactos.git;a=commitdiff;h=81e27f0be79fb92127d02…
commit 81e27f0be79fb92127d028ecaa876a2a187bbf87
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Sat Sep 21 18:21:17 2019 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Sat Sep 21 18:21:17 2019 +0900
[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
---
win32ss/user/ntuser/menu.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/win32ss/user/ntuser/menu.c b/win32ss/user/ntuser/menu.c
index ae98cf0f57c..b7c550bec3a 100644
--- a/win32ss/user/ntuser/menu.c
+++ b/win32ss/user/ntuser/menu.c
@@ -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