diff options
| author | Zufu Liu <unknown> | 2020-05-28 08:26:52 +1000 |
|---|---|---|
| committer | Zufu Liu <unknown> | 2020-05-28 08:26:52 +1000 |
| commit | 1cd0eb50e9e90f08764278b69d97c38f5cb3c204 (patch) | |
| tree | bccc8140b70a1c163b546def88254364a134cf4d /win32 | |
| parent | 387e6f7794fae7bb65018fb57474c693c03225f7 (diff) | |
| download | scintilla-mirror-1cd0eb50e9e90f08764278b69d97c38f5cb3c204.tar.gz | |
Backport: Bug [#2171]. Check for DPI change in WM_DPICHANGED_AFTERPARENT instead of every
paint.
Backport of changeset 8268:61ff49227e40.
Diffstat (limited to 'win32')
| -rw-r--r-- | win32/ScintillaWin.cxx | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index dcae50140..c33944db4 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -98,6 +98,9 @@ #ifndef WM_DPICHANGED #define WM_DPICHANGED 0x02E0 #endif +#ifndef WM_DPICHANGED_AFTERPARENT +#define WM_DPICHANGED_AFTERPARENT 0x02E3 +#endif #ifndef UNICODE_NOCHAR #define UNICODE_NOCHAR 0xFFFF @@ -374,8 +377,6 @@ class ScintillaWin : void AddCharUTF16(wchar_t const *wcs, unsigned int wclen, CharacterSource charSource); Sci::Position EncodedFromUTF8(const char *utf8, char *encoded) const; - void CheckDpiChanged(); - bool PaintDC(HDC hdc); sptr_t WndPaint(); @@ -879,14 +880,6 @@ Sci::Position ScintillaWin::EncodedFromUTF8(const char *utf8, char *encoded) con } } -void ScintillaWin::CheckDpiChanged() { - const UINT dpiNow = DpiForWindow(wMain.GetID()); - if (dpi != dpiNow) { - dpi = dpiNow; - InvalidateStyleData(); - } -} - // Add one character from a UTF-16 string, by converting to either UTF-8 or // the current codepage. Code is similar to HandleCompositionWindowed(). void ScintillaWin::AddCharUTF16(wchar_t const *wcs, unsigned int wclen, CharacterSource charSource) { @@ -937,7 +930,6 @@ bool ScintillaWin::PaintDC(HDC hdc) { } sptr_t ScintillaWin::WndPaint() { - CheckDpiChanged(); //ElapsedPeriod ep; // Redirect assertions to debug output and save current state @@ -1942,6 +1934,15 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam InvalidateStyleRedraw(); break; + case WM_DPICHANGED_AFTERPARENT: { + const UINT dpiNow = DpiForWindow(wMain.GetID()); + if (dpi != dpiNow) { + dpi = dpiNow; + InvalidateStyleRedraw(); + } + } + break; + case WM_CONTEXTMENU: return ShowContextMenu(iMessage, wParam, lParam); |
