aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32
diff options
context:
space:
mode:
authorMarkus Nißl <unknown>2026-04-22 11:17:36 +1000
committerMarkus Nißl <unknown>2026-04-22 11:17:36 +1000
commit5895f2ff84ccb6610342370d4b9ff3940e5f399a (patch)
tree60d9be45ad5b4cef62843a7fa6bf0e799c866bed /win32
parent29f72cb83b1565132c075ba815afbaa2b6e421d1 (diff)
downloadscintilla-mirror-5895f2ff84ccb6610342370d4b9ff3940e5f399a.tar.gz
Bug [#2503]. Update scaling when the application moves to another monitor.
Diffstat (limited to 'win32')
-rw-r--r--win32/ScintillaWin.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx
index f59a5e28e..69a6d307b 100644
--- a/win32/ScintillaWin.cxx
+++ b/win32/ScintillaWin.cxx
@@ -872,7 +872,11 @@ bool ScintillaWin::UpdateRenderingParams(bool force) noexcept {
}
hCurrentMonitor = monitor;
- deviceScaleFactor = Internal::GetDeviceScaleFactorWhenGdiScalingActive(hRootWnd);
+ const float newDeviceScaleFactor = Internal::GetDeviceScaleFactorWhenGdiScalingActive(hRootWnd);
+ if (deviceScaleFactor != newDeviceScaleFactor) {
+ deviceScaleFactor = newDeviceScaleFactor;
+ targets.valid = false;
+ }
renderingParams->defaultRenderingParams = std::move(monitorRenderingParams);
renderingParams->customRenderingParams = std::move(customClearTypeRenderingParams);
return true;
@@ -2434,13 +2438,13 @@ sptr_t ScintillaWin::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) {
case WM_MOUSEACTIVATE:
case WM_NCHITTEST:
case WM_NCCALCSIZE:
- case WM_NCPAINT:
case WM_NCMOUSEMOVE:
case WM_NCLBUTTONDOWN:
case WM_SYSCOMMAND:
case WM_WINDOWPOSCHANGING:
return ::DefWindowProc(MainHWND(), msg, wParam, lParam);
+ case WM_NCPAINT:
case WM_WINDOWPOSCHANGED:
#if defined(USE_D2D)
if (technology != Technology::Default) {