https://bugs.winehq.org/show_bug.cgi?id=46522 Signed-off-by: Roman Pišl rpisl@seznam.cz --- dlls/winex11.drv/window.c | 3 +++ dlls/winex11.drv/x11drv.h | 4 +++- dlls/winex11.drv/xdnd.c | 17 +++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 52e345ceb6..7727b10851 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2742,6 +2742,9 @@ LRESULT CDECL X11DRV_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) return 0; case WM_X11DRV_CLIP_CURSOR: return clip_cursor_notify( hwnd, (HWND)wp, (HWND)lp ); + case WM_X11DRV_DROPEVENT: + X11DRV_XDND_DropEventProcess( hwnd, (XClientMessageEvent*)lp ); + return 0; default: FIXME( "got window msg %x hwnd %p wp %lx lp %lx\n", msg, hwnd, wp, lp ); return 0; diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 98cab8947b..c140c1d474 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -242,6 +242,7 @@ extern void IME_SetResultString(LPWSTR lpResult, DWORD dwResultlen) DECLSPEC_HID
extern void X11DRV_XDND_EnterEvent( HWND hWnd, XClientMessageEvent *event ) DECLSPEC_HIDDEN; extern void X11DRV_XDND_PositionEvent( HWND hWnd, XClientMessageEvent *event ) DECLSPEC_HIDDEN; +extern void X11DRV_XDND_DropEventProcess( HWND hWnd, XClientMessageEvent *event ); extern void X11DRV_XDND_DropEvent( HWND hWnd, XClientMessageEvent *event ) DECLSPEC_HIDDEN; extern void X11DRV_XDND_LeaveEvent( HWND hWnd, XClientMessageEvent *event ) DECLSPEC_HIDDEN; extern void X11DRV_CLIPBOARD_ImportSelection( Display *display, Window win, Atom selection, @@ -537,7 +538,8 @@ enum x11drv_window_messages WM_X11DRV_SET_WIN_REGION, WM_X11DRV_RESIZE_DESKTOP, WM_X11DRV_SET_CURSOR, - WM_X11DRV_CLIP_CURSOR + WM_X11DRV_CLIP_CURSOR, + WM_X11DRV_DROPEVENT };
/* _NET_WM_STATE properties that we keep track of */ diff --git a/dlls/winex11.drv/xdnd.c b/dlls/winex11.drv/xdnd.c index 0cd2ad8892..81992c0714 100644 --- a/dlls/winex11.drv/xdnd.c +++ b/dlls/winex11.drv/xdnd.c @@ -406,6 +406,22 @@ void X11DRV_XDND_PositionEvent( HWND hWnd, XClientMessageEvent *event ) * Handle an XdndDrop event. */ void X11DRV_XDND_DropEvent( HWND hWnd, XClientMessageEvent *event ) +{ + XClientMessageEvent *drop_event = HeapAlloc(GetProcessHeap(), 0, sizeof(*drop_event)); + if (!drop_event) + return; + + memcpy(drop_event, event, sizeof(*event)); + if (!PostMessageW(hWnd, WM_X11DRV_DROPEVENT, 0, (LPARAM)drop_event)) + HeapFree(GetProcessHeap(), 0, drop_event); +} + +/************************************************************************** + * X11DRV_XDND_DropEventProcess + * + * Process an XdndDrop event. + */ +void X11DRV_XDND_DropEventProcess( HWND hWnd, XClientMessageEvent *event ) { XClientMessageEvent e; IDropTarget *dropTarget; @@ -492,6 +508,7 @@ void X11DRV_XDND_DropEvent( HWND hWnd, XClientMessageEvent *event ) else e.data.l[2] = None; XSendEvent(event->display, event->data.l[0], False, NoEventMask, (XEvent*)&e); + HeapFree(GetProcessHeap(), 0, event); }
/**************************************************************************