@@ -7,7 +7,7 @@ use std::rc::{Rc, Weak};
7
7
use winapi:: shared:: guiddef:: { IsEqualIID , REFIID } ;
8
8
use winapi:: shared:: minwindef:: { DWORD , WPARAM } ;
9
9
use winapi:: shared:: ntdef:: { HRESULT , ULONG } ;
10
- use winapi:: shared:: windef:: POINTL ;
10
+ use winapi:: shared:: windef:: { POINT , POINTL } ;
11
11
use winapi:: shared:: winerror:: { E_NOINTERFACE , E_UNEXPECTED , S_OK } ;
12
12
use winapi:: shared:: wtypes:: DVASPECT_CONTENT ;
13
13
use winapi:: um:: objidl:: { IDataObject , FORMATETC , STGMEDIUM , TYMED_HGLOBAL } ;
@@ -17,7 +17,7 @@ use winapi::um::oleidl::{
17
17
} ;
18
18
use winapi:: um:: shellapi:: { DragQueryFileW , HDROP } ;
19
19
use winapi:: um:: unknwnbase:: { IUnknown , IUnknownVtbl } ;
20
- use winapi:: um:: winuser:: CF_HDROP ;
20
+ use winapi:: um:: winuser:: { ScreenToClient , CF_HDROP } ;
21
21
use winapi:: Interface ;
22
22
23
23
use crate :: { DropData , DropEffect , Event , EventStatus , MouseEvent , PhyPoint , Point } ;
@@ -114,7 +114,8 @@ impl DropTarget {
114
114
let Some ( window_state) = self . window_state . upgrade ( ) else {
115
115
return ;
116
116
} ;
117
-
117
+ let mut pt = POINT { x : pt. x , y : pt. y } ;
118
+ unsafe { ScreenToClient ( window_state. hwnd , & mut pt as * mut POINT ) } ;
118
119
let phy_point = PhyPoint :: new ( pt. x , pt. y ) ;
119
120
self . drag_position = phy_point. to_logical ( & window_state. window_info ( ) ) ;
120
121
}
0 commit comments