Jacek Caban : user32: Use GetClientRect in EDIT_WM_ContextMenu.

Alexandre Julliard julliard at winehq.org
Fri Aug 5 14:42:32 CDT 2022


Module: wine
Branch: master
Commit: 98128a65e7e10d705d90ad05e2b5ff3ca517b6cb
URL:    https://gitlab.winehq.org/wine/wine/-/commit/98128a65e7e10d705d90ad05e2b5ff3ca517b6cb

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Jul 29 19:36:20 2022 +0200

user32: Use GetClientRect in EDIT_WM_ContextMenu.

---

 dlls/user32/edit.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c
index 80758dd60ef..81296f7deeb 100644
--- a/dlls/user32/edit.c
+++ b/dlls/user32/edit.c
@@ -3328,11 +3328,16 @@ static void EDIT_WM_ContextMenu(EDITSTATE *es, INT x, INT y)
 
         if (x == -1 && y == -1) /* passed via VK_APPS press/release */
         {
+            POINT pt;
             RECT rc;
+
             /* Windows places the menu at the edit's center in this case */
-            WIN_GetRectangles( es->hwndSelf, COORDS_SCREEN, NULL, &rc );
-            x = rc.left + (rc.right - rc.left) / 2;
-            y = rc.top + (rc.bottom - rc.top) / 2;
+            GetClientRect( es->hwndSelf, &rc );
+            pt.x = rc.right / 2;
+            pt.y = rc.bottom / 2;
+            ClientToScreen( es->hwndSelf, &pt );
+            x = pt.x;
+            y = pt.y;
         }
 
 	if (!(es->flags & EF_FOCUSED))




More information about the wine-cvs mailing list