@@ -7,7 +7,7 @@ use std::rc::{Rc, Weak};
77use winapi:: shared:: guiddef:: { IsEqualIID , REFIID } ;
88use winapi:: shared:: minwindef:: { DWORD , WPARAM } ;
99use winapi:: shared:: ntdef:: { HRESULT , ULONG } ;
10- use winapi:: shared:: windef:: POINTL ;
10+ use winapi:: shared:: windef:: { POINT , POINTL } ;
1111use winapi:: shared:: winerror:: { E_NOINTERFACE , E_UNEXPECTED , S_OK } ;
1212use winapi:: shared:: wtypes:: DVASPECT_CONTENT ;
1313use winapi:: um:: objidl:: { IDataObject , FORMATETC , STGMEDIUM , TYMED_HGLOBAL } ;
@@ -17,7 +17,7 @@ use winapi::um::oleidl::{
1717} ;
1818use winapi:: um:: shellapi:: { DragQueryFileW , HDROP } ;
1919use winapi:: um:: unknwnbase:: { IUnknown , IUnknownVtbl } ;
20- use winapi:: um:: winuser:: CF_HDROP ;
20+ use winapi:: um:: winuser:: { ScreenToClient , CF_HDROP } ;
2121use winapi:: Interface ;
2222
2323use crate :: { DropData , DropEffect , Event , EventStatus , MouseEvent , PhyPoint , Point } ;
@@ -114,7 +114,8 @@ impl DropTarget {
114114 let Some ( window_state) = self . window_state . upgrade ( ) else {
115115 return ;
116116 } ;
117-
117+ let mut pt = POINT { x : pt. x , y : pt. y } ;
118+ unsafe { ScreenToClient ( window_state. hwnd , & mut pt as * mut POINT ) } ;
118119 let phy_point = PhyPoint :: new ( pt. x , pt. y ) ;
119120 self . drag_position = phy_point. to_logical ( & window_state. window_info ( ) ) ;
120121 }
0 commit comments