From: Akihiro Sagawa Subject: [PATCH 3/3] winex11.drv: Indicate whether the drop point is outside of the client area. Message-Id: <20190716220112.3AD1.375B48EC@gmail.com> Date: Tue, 16 Jul 2019 22:05:13 +0900 For instance, the menu bar is outside of the client area, so fNC is TRUE. Signed-off-by: Akihiro Sagawa --- 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)));