aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32/ScintillaWin.cxx
diff options
context:
space:
mode:
authorMarkus Nißl <unknown>2022-10-29 21:05:25 +1100
committerMarkus Nißl <unknown>2022-10-29 21:05:25 +1100
commitc0371d58dfd4d055b040ba7274fb5b537532d257 (patch)
tree38d75d82fbe12ee04985f17395ac1fb715f6c411 /win32/ScintillaWin.cxx
parente04a2cf64168091c804bb8856db6cb5d85d3251d (diff)
downloadscintilla-mirror-c0371d58dfd4d055b040ba7274fb5b537532d257.tar.gz
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/
Diffstat (limited to 'win32/ScintillaWin.cxx')
-rw-r--r--win32/ScintillaWin.cxx3
1 files changed, 2 insertions, 1 deletions
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;
}