diff options
Diffstat (limited to 'win32/PlatWin.cxx')
-rw-r--r-- | win32/PlatWin.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index b52aa477a..0b36c42da 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -374,7 +374,7 @@ struct FontDirectWrite : public FontWin { } -HMONITOR MonitorFromWindow(HWND hWnd) noexcept { +HMONITOR MonitorFromWindowHandleScaling(HWND hWnd) noexcept { constexpr DWORD monitorFlags = MONITOR_DEFAULTTONEAREST; if (!fnSetThreadDpiAwarenessContext) { @@ -398,7 +398,7 @@ int GetDeviceScaleFactorWhenGdiScalingActive(HWND hWnd) noexcept { PLATFORM_ASSERT(fnGetWindowDpiAwarenessContext && fnGetScaleFactorForMonitor); if (fnAreDpiAwarenessContextsEqual(DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED, fnGetWindowDpiAwarenessContext(hWnd))) { const HWND hRootWnd = ::GetAncestor(hWnd, GA_ROOT); // Scale factor applies to entire (root) window. - const HMONITOR hMonitor = MonitorFromWindow(hRootWnd, MONITOR_DEFAULTTONEAREST); + const HMONITOR hMonitor = MonitorFromWindowHandleScaling(hRootWnd); DEVICE_SCALE_FACTOR deviceScaleFactor; if (S_OK == fnGetScaleFactorForMonitor(hMonitor, &deviceScaleFactor)) return (static_cast<int>(deviceScaleFactor) + 99) / 100; // increase to first integral multiple of 1 |