From 196d0a73b4a198652bcb86eb36d7adec7bc1387e Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Thu, 13 Jul 2017 11:42:45 +0000 Subject: 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 --- src/fl_dnd_win32.cxx | 9 ++++----- 1 file 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; -- cgit v1.2.3