From 5895f2ff84ccb6610342370d4b9ff3940e5f399a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Ni=C3=9Fl?= Date: Wed, 22 Apr 2026 11:17:36 +1000 Subject: Bug [#2503]. Update scaling when the application moves to another monitor. --- win32/ScintillaWin.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'win32') 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) { -- cgit v1.2.3