Akihiro Sagawa : winex11.drv: Indicate whether the drop point is non-client area.

Alexandre Julliard julliard at winehq.org
Mon Aug 19 15:35:12 CDT 2019


Module: wine
Branch: master
Commit: aaac4e25ab10f6d27047917d21fe74888387b2ce
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=aaac4e25ab10f6d27047917d21fe74888387b2ce

Author: Akihiro Sagawa <sagawa.aki at gmail.com>
Date:   Thu Aug 15 22:06:33 2019 +0900

winex11.drv: Indicate whether the drop point is non-client area.

Signed-off-by: Akihiro Sagawa <sagawa.aki at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winex11.drv/xdnd.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/dlls/winex11.drv/xdnd.c b/dlls/winex11.drv/xdnd.c
index 1f7f0d9..8dc4a5b 100644
--- a/dlls/winex11.drv/xdnd.c
+++ b/dlls/winex11.drv/xdnd.c
@@ -636,12 +636,15 @@ static HRESULT X11DRV_XDND_SendDropFiles(HWND hwnd)
         HGLOBAL dropHandle = GlobalAlloc(GMEM_FIXED, GlobalSize(current->contents));
         if (dropHandle)
         {
+            RECT rect;
             DROPFILES *lpDrop = GlobalLock(dropHandle);
             memcpy(lpDrop, GlobalLock(current->contents), GlobalSize(current->contents));
             GlobalUnlock(current->contents);
             lpDrop->pt.x = XDNDxy.x;
             lpDrop->pt.y = XDNDxy.y;
-            lpDrop->fNC  = !ScreenToClient(hwnd, &lpDrop->pt);
+            lpDrop->fNC  = !(ScreenToClient(hwnd, &lpDrop->pt) &&
+                             GetClientRect(hwnd, &rect) &&
+                             PtInRect(&rect, lpDrop->pt));
             TRACE("Sending WM_DROPFILES: hWnd=0x%p, fNC=%d, x=%d, y=%d, files=%p(%s)\n", hwnd,
                     lpDrop->fNC, lpDrop->pt.x, lpDrop->pt.y, ((char*)lpDrop) + lpDrop->pFiles,
                     debugstr_w((WCHAR*)(((char*)lpDrop) + lpDrop->pFiles)));




More information about the wine-cvs mailing list