From aaac4e25ab10f6d27047917d21fe74888387b2ce Mon Sep 17 00:00:00 2001 From: Akihiro Sagawa Date: Thu, 15 Aug 2019 22:06:33 +0900 Subject: [PATCH] winex11.drv: Indicate whether the drop point is non-client area. Signed-off-by: Akihiro Sagawa Signed-off-by: Alexandre Julliard --- 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 1f7f0d932bf..8dc4a5bce23 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)));