From c0371d58dfd4d055b040ba7274fb5b537532d257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Ni=C3=9Fl?= Date: Sat, 29 Oct 2022 21:05:25 +1100 Subject: Bug [#2344]. Use the top-level window to find the monitor for DirectWrite rendering parameters. Temporarily switch DPI awareness to find correct monitor in GDI scaling mode. https://sourceforge.net/p/scintilla/code/merge-requests/34/ --- win32/ScintillaWin.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'win32/ScintillaWin.cxx') diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index c405ed8d1..d3c1b87a5 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -603,7 +603,8 @@ bool ScintillaWin::UpdateRenderingParams(bool force) noexcept { return false; } } - HMONITOR monitor = ::MonitorFromWindow(MainHWND(), MONITOR_DEFAULTTONEAREST); + const HWND hRootWnd = ::GetAncestor(MainHWND(), GA_ROOT); + const HMONITOR monitor = Internal::MonitorFromWindow(hRootWnd); if (!force && monitor == hCurrentMonitor && renderingParams->defaultRenderingParams) { return false; } -- cgit v1.2.3