diff options
| author | Manolo Gouy <Manolo> | 2017-07-13 11:42:45 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2017-07-13 11:42:45 +0000 |
| commit | 196d0a73b4a198652bcb86eb36d7adec7bc1387e (patch) | |
| tree | 31d5464ee87a63360cdfaa921200003c27ca92ea /src/fl_dnd_win32.cxx | |
| parent | c92fee897b6d4992f46a0295221728d0c15f2708 (diff) | |
Fix for STR#3390 Drop to FLTK widget fails when desktop is scaled - new solution.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12315 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/fl_dnd_win32.cxx')
| -rw-r--r-- | src/fl_dnd_win32.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/fl_dnd_win32.cxx b/src/fl_dnd_win32.cxx index 51f656da8..2c64a5ad8 100644 --- a/src/fl_dnd_win32.cxx +++ b/src/fl_dnd_win32.cxx @@ -88,15 +88,14 @@ public: of the DragEnter, DragOver, and Drop member functions. DragEnter receives the mouse coordinates in unscaled screen units, whereas DragOver and Drop receive the mouse coordinates in scaled units. -In the first case, dividing coordinates by DWM_scaling_factor() gives the scaled units used everywhere else. - + DPI–aware applications transmit unscaled screen units to all 3 member functions. These coordinates should be divided by the window's scale to get FLTK units. */ #ifndef FLTK_HIDPI_SUPPORT - float dwm_s = ((Fl_WinAPI_Screen_Driver*)Fl::screen_driver())->DWM_scaling_factor(); - pt.x /= dwm_s; - pt.y /= dwm_s; + int mx, my; + Fl::screen_driver()->get_mouse(mx, my); // bypass Windows bug that gives mouse coordinates in unscaled screen units + pt.x = mx; pt.y = my; #endif POINT ppt; Fl::e_x_root = ppt.x = pt.x; |
