From 7909c514d76359577accb9c2417590e6cff4e184 Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 28 May 2025 10:00:12 +1000 Subject: Bug [#2481]. Refresh pixmaps later inside Paint so non-null when dereferenced in for validity check. --- doc/ScintillaHistory.html | 4 ++++ src/Editor.cxx | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 4d3c73774..5b636af5d 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -616,6 +616,10 @@ Notepad++ Pull Request #16373.
  • + Fix crash during painting when scroll bars changed. + Bug #2481. +
  • +
  • On GTK, reset vertical scroll bar synchronously in SCI_SETDOCPOINTER to fix bug where scroll position not restored in non-wrap mode. Bug #2416. diff --git a/src/Editor.cxx b/src/Editor.cxx index d941612b1..d081c989e 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -1868,7 +1868,6 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) { RefreshStyleData(); if (paintState == PaintState::abandoned) return; // Scroll bars may have changed so need redraw - RefreshPixMaps(surfaceWindow); paintAbandonedByStyling = false; @@ -1880,7 +1879,6 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) { if (NotifyUpdateUI()) { RefreshStyleData(); - RefreshPixMaps(surfaceWindow); } // Wrap the visible lines if needed. @@ -1890,9 +1888,10 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) { if (AbandonPaint()) { return; } - RefreshPixMaps(surfaceWindow); // In case pixmaps invalidated by scrollbar change } + RefreshPixMaps(surfaceWindow); + if (!marginView.pixmapSelPattern->Initialised()) { // When Direct2D is used, pixmap creation may fail with D2DERR_RECREATE_TARGET so // abandon this paint to avoid further failures. -- cgit v1.2.3