diff options
author | Neil <nyamatongwe@gmail.com> | 2019-03-05 08:30:32 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2019-03-05 08:30:32 +1100 |
commit | fe66239c3dd005d7cc54c2b3856c516c4c977f96 (patch) | |
tree | c870bdcb05c76c0b81445424b4c89aad1bab292c | |
parent | c9ca7b34a0c5c0da60fe6d8bbf38df2424b76864 (diff) | |
download | scintilla-mirror-fe66239c3dd005d7cc54c2b3856c516c4c977f96.tar.gz |
Remove feature where WM_PAINT treated wParam as a PAINTSTRUCT*.
-rw-r--r-- | doc/ScintillaHistory.html | 3 | ||||
-rw-r--r-- | win32/ScintillaWin.cxx | 33 |
2 files changed, 13 insertions, 23 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 3f38d74b5..c858b31fd 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -563,6 +563,9 @@ Improve the styling of numbers in Nim. <a href="https://sourceforge.net/p/scintilla/feature-requests/1268/">Feature #1268</a>. </li> + <li> + On Win32, removed special handling of non-0 wParam to WM_PAINT. + </li> <ul> <h3> <a href="https://www.scintilla.org/scite414.zip">Release 4.1.4</a> diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 7b9c77bcc..e6f725d18 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -321,7 +321,7 @@ class ScintillaWin : Sci::Position TargetAsUTF8(char *text) const; void AddCharUTF16(wchar_t const *wcs, unsigned int wclen); Sci::Position EncodedFromUTF8(const char *utf8, char *encoded) const; - sptr_t WndPaint(uptr_t wParam); + sptr_t WndPaint(); sptr_t HandleCompositionWindowed(uptr_t wParam, sptr_t lParam); sptr_t HandleCompositionInline(uptr_t wParam, sptr_t lParam); @@ -836,39 +836,31 @@ void ScintillaWin::AddCharUTF16(wchar_t const *wcs, unsigned int wclen) { } } -sptr_t ScintillaWin::WndPaint(uptr_t wParam) { +sptr_t ScintillaWin::WndPaint() { //ElapsedPeriod ep; // Redirect assertions to debug output and save current state const bool assertsPopup = Platform::ShowAssertionPopUps(false); paintState = painting; PAINTSTRUCT ps; - PAINTSTRUCT *pps; - const bool IsOcxCtrl = (wParam != 0); // if wParam != 0, it contains - // a PAINTSTRUCT* from the OCX // Removed since this interferes with reporting other assertions as it occurs repeatedly //PLATFORM_ASSERT(hRgnUpdate == NULL); hRgnUpdate = ::CreateRectRgn(0, 0, 0, 0); - if (IsOcxCtrl) { - pps = reinterpret_cast<PAINTSTRUCT*>(wParam); - } else { - ::GetUpdateRgn(MainHWND(), hRgnUpdate, FALSE); - pps = &ps; - ::BeginPaint(MainHWND(), pps); - } - rcPaint = PRectangle::FromInts(pps->rcPaint.left, pps->rcPaint.top, pps->rcPaint.right, pps->rcPaint.bottom); + ::GetUpdateRgn(MainHWND(), hRgnUpdate, FALSE); + ::BeginPaint(MainHWND(), &ps); + rcPaint = PRectangle::FromInts(ps.rcPaint.left, ps.rcPaint.top, ps.rcPaint.right, ps.rcPaint.bottom); const PRectangle rcClient = GetClientRectangle(); paintingAllText = BoundsContains(rcPaint, hRgnUpdate, rcClient); if (technology == SC_TECHNOLOGY_DEFAULT) { - AutoSurface surfaceWindow(pps->hdc, this); + AutoSurface surfaceWindow(ps.hdc, this); if (surfaceWindow) { Paint(surfaceWindow, rcPaint); surfaceWindow->Release(); } } else { #if defined(USE_D2D) - EnsureRenderTarget(pps->hdc); + EnsureRenderTarget(ps.hdc); AutoSurface surfaceWindow(pRenderTarget, this); if (surfaceWindow) { pRenderTarget->BeginDraw(); @@ -887,15 +879,10 @@ sptr_t ScintillaWin::WndPaint(uptr_t wParam) { hRgnUpdate = 0; } - if (!IsOcxCtrl) - ::EndPaint(MainHWND(), pps); + ::EndPaint(MainHWND(), &ps); if (paintState == paintAbandoned) { // Painting area was insufficient to cover new styling or brace highlight positions - if (IsOcxCtrl) { - FullPaintDC(pps->hdc); - } else { - FullPaint(); - } + FullPaint(); } paintState = notPainting; @@ -1278,7 +1265,7 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam Command(LOWORD(wParam)); break; case WM_PAINT: - return WndPaint(wParam); + return WndPaint(); case WM_PRINTCLIENT: { HDC hdc = reinterpret_cast<HDC>(wParam); |