From b78a9f1aa14d2d43ee7e62f617a3c7bdf576dd4b Mon Sep 17 00:00:00 2001 From: Damjan Jovanovic Date: Fri, 7 Aug 2015 04:17:40 +0200 Subject: [PATCH] winex11: Only send WM_DROPFILES if there is no drop target. Windows doesn't send WM_DROPFILES to a window if a drop target is registered on that window. Some apps that support both even duplicate dropped files if we send it and a drop target is registered. --- 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 f6ce5e9d85c..9944dabd9c5 100644 --- a/dlls/winex11.drv/xdnd.c +++ b/dlls/winex11.drv/xdnd.c @@ -378,10 +378,6 @@ void X11DRV_XDND_DropEvent( HWND hWnd, XClientMessageEvent *event ) TRACE("\n"); - /* 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) @@ -407,6 +403,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();