diff options
-rw-r--r-- | win32/PlatWin.cxx | 4 | ||||
-rw-r--r-- | win32/PlatWin.h | 2 | ||||
-rw-r--r-- | win32/ScintillaWin.cxx | 2 |
3 files changed, 4 insertions, 4 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 diff --git a/win32/PlatWin.h b/win32/PlatWin.h index aa16e9f89..1391723dd 100644 --- a/win32/PlatWin.h +++ b/win32/PlatWin.h @@ -43,7 +43,7 @@ inline HWND HwndFromWindow(const Window &w) noexcept { void *PointerFromWindow(HWND hWnd) noexcept; void SetWindowPointer(HWND hWnd, void *ptr) noexcept; -HMONITOR MonitorFromWindow(HWND hWnd) noexcept; +HMONITOR MonitorFromWindowHandleScaling(HWND hWnd) noexcept; UINT DpiForWindow(WindowID wid) noexcept; int GetDeviceScaleFactorWhenGdiScalingActive(HWND hWnd) noexcept; diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index efbe1f000..42927433f 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -606,7 +606,7 @@ bool ScintillaWin::UpdateRenderingParams(bool force) noexcept { } } const HWND hRootWnd = ::GetAncestor(MainHWND(), GA_ROOT); - const HMONITOR monitor = Internal::MonitorFromWindow(hRootWnd); + const HMONITOR monitor = Internal::MonitorFromWindowHandleScaling(hRootWnd); if (!force && monitor == hCurrentMonitor && renderingParams->defaultRenderingParams) { return false; } |