Module: wine Branch: master Commit: b78a9f1aa14d2d43ee7e62f617a3c7bdf576dd4b URL: http://source.winehq.org/git/wine.git/?a=commit;h=b78a9f1aa14d2d43ee7e62f617...
Author: Damjan Jovanovic damjan.jov@gmail.com Date: Fri Aug 7 04:17:40 2015 +0200
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 f6ce5e9..9944dab 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();