From 090aef2d7060f6a7efd7c30dffcf52a23a658f30 Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 19 Feb 2019 16:01:40 +0000 Subject: [PATCH] Windows: Fixed file drag and drop for Windows 8 --- modules/juce_gui_basics/native/juce_win32_Windowing.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp index 87ec415962..8142dbd28f 100644 --- a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp @@ -1732,10 +1732,13 @@ public: Point screenPos; #if JUCE_WIN_PER_MONITOR_DPI_AWARE - screenPos = convertPhysicalScreenPointToLogical (pointFromPOINT ({ mousePos.x, mousePos.y }), (HWND) peer.getNativeHandle()).toFloat(); - #else - screenPos = pointFromPOINT ({ mousePos.x, mousePos.y }).toFloat() / static_cast (getGlobalDPI() / USER_DEFAULT_SCREEN_DPI); + auto h = (HWND) peer.getNativeHandle(); + + if (isPerMonitorDPIAwareWindow (h)) + screenPos = convertPhysicalScreenPointToLogical (pointFromPOINT ({ mousePos.x, mousePos.y }), h).toFloat(); + else #endif + screenPos = pointFromPOINT ({ mousePos.x, mousePos.y }).toFloat() / static_cast (getGlobalDPI() / USER_DEFAULT_SCREEN_DPI); return peer.getComponent().getLocalPoint (nullptr, screenPos); }