From 4095fb14c4c25c976088bc6f0339fa339b51edd6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 28 Jun 2008 01:40:42 +0000 Subject: [PATCH] don't call OnData() if OnEnter() rejected the drag (#9634) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54398 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/ole/droptgt.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/msw/ole/droptgt.cpp b/src/msw/ole/droptgt.cpp index 4601d19be4..3ca2761733 100644 --- a/src/msw/ole/droptgt.cpp +++ b/src/msw/ole/droptgt.cpp @@ -244,15 +244,20 @@ STDMETHODIMP wxIDropTarget::DragOver(DWORD grfKeyState, result = wxDragNone; } - // we need client coordinates to pass to wxWin functions - if ( !ScreenToClient(m_hwnd, (POINT *)&pt) ) - { - wxLogLastError(wxT("ScreenToClient")); - } + if ( result != wxDragNone ) { + // we need client coordinates to pass to wxWin functions + if ( !ScreenToClient(m_hwnd, (POINT *)&pt) ) + { + wxLogLastError(wxT("ScreenToClient")); + } - *pdwEffect = ConvertDragResultToEffect( - m_pTarget->OnDragOver(pt.x, pt.y, result) - ); + *pdwEffect = ConvertDragResultToEffect( + m_pTarget->OnDragOver(pt.x, pt.y, result) + ); + } + else { + *pdwEffect = DROPEFFECT_NONE; + } return S_OK; } -- 2.49.0