[PATCH 7/8] winex11.drv: improve relaying drop effects to the drop target

Damjan Jovanovic damjan.jov at gmail.com
Sat Jul 4 08:37:44 CDT 2015


The XDND spec provides only a single action that can be offered to the
drop target through the XdndPosition message. In practice this is too
restrictive: many drag sources can offer multiple actions, of which
only some will be suitable for a drop target. When dragging a file
from a file manager, the safest single action to offer is COPY, but
the trash can only accepts MOVE, so you'd have to Shift+drag a file to
be able to drop it in the trash can.

GTK+, Java and Mono all use an extension to the XDND spec, in which
there is a property, XdndActionList, containing a list of all actions
(as X11 atoms) that can be performed, while XdndPosition's single
action is just the suggested or preferred action.

On Windows the drop target gets provided with a set of allowed
actions, and the key state that indicates the suggested action. There
is no way to indicate key state on XDND - XdndPosition's data.l[1]
contains event state, but doesn't contain enough of it to tell us a
right drag is happening, and besides, absolutely nobody, not even the
spec's reference implementation, actually reads or writes data.l[1] in
XdndPosition. So what we do is translate XdndActionList into
pdwEffect, and translate XdndPosition's suggested action into the key
state that would have generated that action.

Damjan Jovanovic
---
 dlls/winex11.drv/x11drv.h      |   1 +
 dlls/winex11.drv/x11drv_main.c |   1 +
 dlls/winex11.drv/xdnd.c        | 124 +++++++++++++++++++++++++++++++++--------
 3 files changed, 103 insertions(+), 23 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0007-winex11.drv-improve-relaying-drop-effects-to-the-drop-.txt
Type: text/x-patch
Size: 10443 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20150704/67eebfe8/attachment.bin>


More information about the wine-patches mailing list