https://bugs.winehq.org/show_bug.cgi?id=55179
Damjan Jovanovic damjan.jov@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Component|-unknown |winex11.drv
--- Comment #6 from Damjan Jovanovic damjan.jov@gmail.com --- Thank you Pascal.
In the output you pasted, it says:
---snip--- 02d4:trace:xdnd:x11drv_dnd_position_event the application accepted the drop (effect = 0) ---snip---
the effect of 0 is probably where things break. I wonder why. What drop action and data formats do we offer the app?
Possibly related to bug 51772 which I could never reproduce as installing the app is too difficult, and they patched around it on their side anyway.
Running with WINEDEBUG='+xdnd,+event' gives me:
---snip--- 0024:trace:event:handle_xdnd_enter_event ver(5) check-XdndTypeList(0) data=23077774,83886080,627,0,0 0024:trace:event:handle_xdnd_enter_event XDNDEnterAtom 627: text/uri-list 0024:trace:xdnd:X11DRV_XDND_FreeDragDropOp 0024:trace:event:call_event_handler 477 ClientMessage for hwnd/window 0x1008a/4400004 0024:trace:xdnd:create_stream_from_map size 4096 0024:trace:xdnd:XDNDDATAOBJECT_AddRef (031A2044) 0024:trace:xdnd:x11drv_dnd_position_event the application accepted the drop (effect = 0) 0024:trace:xdnd:create_stream_from_map size 4096 0024:trace:event:handle_xdnd_position_event actionRequested(537) chosen(0x0) at x(644),y(760) ---snip---
text/uri-list is offered, and
---snip--- $ xlsatoms | grep 537 537 XdndActionCopy ---snip---
is the drag format from the source, which are both correct. So where do things go wrong?
Apparently within function x11drv_dnd_position_event() of dlls/winex11.drv/xdnd.c, the call to the application's IDropTarget_DragOver() leads to the application returning an effect of 0 to handle_xdnd_position_event(), where
---snip--- e.data.l[1] = !!effect; ---snip---
which becomes 0, and as per https://freedesktop.org/wiki/Specifications/XDND/ this means:
---snip--- data.l[1]: Bit 0 is set if the current target will accept the drop. ---snip---
so it tells the drag source that the drop target is not accepting the drop, making it give up on the drag operation, and leaving the user unable to drop the file.
We should ignore the value of the drop effect returned by the application's IDropTarget_DragOver(), just like we already do for IDropTarget_DragEnter().
When I change x11drv_dnd_position_event() to do that, I can successfully drop the attached .gpx file into the application.
Confirming and setting component. I'll push a merge request soon.