aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32/ScintillaWin.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'win32/ScintillaWin.cxx')
-rw-r--r--win32/ScintillaWin.cxx23
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);