From: Damjan Jovanovic Subject: [PATCH 4/7] winex11.drv: only send WM_DROPFILES if there is no drop target (try 3) Message-Id: Date: Sat, 18 Jul 2015 10:43:01 +0200 Windows doesn't send WM_DROPFILES to a window if a drop target is registered on that window. Some apps that support both duplicate dropped files if we send it. Closes #29081. Try 2 and 3: no changes Damjan Jovanovic --- dlls/winex11.drv/xdnd.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dlls/winex11.drv/xdnd.c b/dlls/winex11.drv/xdnd.c index 5ec6b6b..a177957 100644 --- a/dlls/winex11.drv/xdnd.c +++ b/dlls/winex11.drv/xdnd.c @@ -390,10 +390,6 @@ void X11DRV_XDND_DropEvent( HWND hWnd, XClientMessageEvent *event ) XDNDDropTargetWindow = event->window; XDNDTimestamp = event->data.l[2]; - /* If we have a HDROP type we send a WM_ACCEPTFILES.*/ - if (GetWindowLongW( hWnd, GWL_EXSTYLE ) & WS_EX_ACCEPTFILES) - X11DRV_XDND_SendDropFiles( hWnd ); - /* Notify OLE of Drop */ dropTarget = get_droptarget_pointer(XDNDLastDropTargetWnd); if (dropTarget) @@ -419,6 +415,13 @@ void X11DRV_XDND_DropEvent( HWND hWnd, XClientMessageEvent *event ) WARN("drop failed, error 0x%08X\n", hr); IDropTarget_Release(dropTarget); } + else + { + /* Only send WM_DROPFILES if there is no drop target. Doing both + * causes winamp to duplicate the dropped files (#29081) */ + if (GetWindowLongW( hWnd, GWL_EXSTYLE ) & WS_EX_ACCEPTFILES) + X11DRV_XDND_SendDropFiles( hWnd ); + } X11DRV_XDND_FreeDragDropOp();