[PATCH 2/3] include/ole32/user32/winemac.drv/winex11.drv: do not allow dropping drags through obscuring native windows

Damjan Jovanovic damjan.jov at gmail.com
Sun Mar 1 22:32:24 CST 2015

Currently Wine does not support dragging from a Wine window to a
native Window, but does from a Wine window to another Wine window.
What is a big surprise though, is that if a Wine window is obscured by
a native window that's on top of it in the z-order, it looks like you
are dropping onto the native window, but you are actually dropping
THROUGH the native window into the Wine window - in other words, the
wrong application gets the drop!

This patch fixes that problem by giving ole32 awareness of native
windows (represented by a ULONG_PTR) via new Wine-specific functions
in user32 that are implemented by the display drivers winex11.drv and
winemac.drv (of which only the former is implemented by this patch).
The ole32 drag loop can thus tell whether the window under the mouse
is a Wine window or a native window, and obtain IDropTarget from
either window type, something that is used by the next patch to
implement dragging from Wine to native windows.

On the winex11.drv side, XTranslateCoordinates() searches down from
the root window for the first X11 window with a winContext or the new
IAmWine window property that all Wine's windows are now given (as
Wine's X11 windows don't have a winContext all the time), and if so
assumes the window is Wine's and proceeds on the ole32 side as before.
Otherwise it stops the search and reports an X11 window as soon as it
finds the XdndAware property set, or when XTranslateCoordinates()
can't find any further children at the given coordinates.

Damjan Jovanovic
 dlls/ole32/ole2.c                 | 52 +++++++++++++++++++++++-------
 dlls/user32/driver.c              | 16 +++++++++
 dlls/user32/user32.spec           |  2 ++
 dlls/user32/user_private.h        |  2 ++
 dlls/user32/win.c                 | 16 +++++++++
 dlls/winemac.drv/dragdrop.c       | 17 ++++++++++
 dlls/winemac.drv/winemac.drv.spec |  3 ++
 dlls/winex11.drv/window.c         |  3 ++
 dlls/winex11.drv/winex11.drv.spec |  2 ++
 dlls/winex11.drv/x11drv.h         |  1 +
 dlls/winex11.drv/x11drv_main.c    |  1 +
 dlls/winex11.drv/xdnd.c           | 68 +++++++++++++++++++++++++++++++++++++++
 include/winuser.h                 |  2 ++
 13 files changed, 174 insertions(+), 11 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-include-ole32-user32-winemac.drv-winex11.drv-do-not-al.txt
Type: text/x-patch
Size: 15598 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20150302/94341b41/attachment-0001.bin>

More information about the wine-patches mailing list