diff options
| -rw-r--r-- | doc/ScintillaHistory.html | 4 | ||||
| -rw-r--r-- | win32/ScintillaWin.cxx | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index c0f884f6a..ea660ae37 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -609,6 +609,10 @@ On Win32 with DirectWrite in a GDI scaled application, draw sharper text in autocompletion lists. <a href="https://sourceforge.net/p/scintilla/bugs/2505/">Bug #2505</a>. </li> + <li> + On Win32 update scaling when the application moves to another monitor. + <a href="https://sourceforge.net/p/scintilla/bugs/2503/">Bug #2503</a>. + </li> </ul> <h3> <a href="https://www.scintilla.org/scintilla561.zip">Release 5.6.1</a> 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) { |
