aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMat Berchtold <unknown>2020-02-15 09:02:56 +1100
committerMat Berchtold <unknown>2020-02-15 09:02:56 +1100
commit127264a1b4984a2b23ff5c66ff5778630701a70c (patch)
treeab51b0c3feb1601c7e282e550bc8ce01cfad6db1
parentb45dbedb37bcd591bf18d8891190acacbbc35bd7 (diff)
downloadscintilla-mirror-127264a1b4984a2b23ff5c66ff5778630701a70c.tar.gz
Backport: Bug [#2138]. Potential fix to Direct2D crash when updating driver.
Backport of changeset 7985:0ffb5afdbd7f.
-rw-r--r--doc/ScintillaHistory.html4
-rw-r--r--src/Editor.cxx8
2 files changed, 11 insertions, 1 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 1c502ee53..bdef04b8f 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -594,6 +594,10 @@
<a href="https://sourceforge.net/p/scintilla/bugs/2152/">Bug #2152</a>.
</li>
<li>
+ Crash fixed with Direct2D on Win32 when updating driver.
+ <a href="https://sourceforge.net/p/scintilla/bugs/2138/">Bug #2138</a>.
+ </li>
+ <li>
Improve IME behaviour on GTK.
Set candidate position for windowed IME.
Improve location of candidate window.
diff --git a/src/Editor.cxx b/src/Editor.cxx
index aec983f00..5da9f2b75 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -1748,7 +1748,13 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {
}
RefreshPixMaps(surfaceWindow); // In case pixmaps invalidated by scrollbar change
}
- PLATFORM_ASSERT(marginView.pixmapSelPattern->Initialised());
+
+ if (!marginView.pixmapSelPattern->Initialised()) {
+ // When Direct2D is used, pixmap creation may fail with D2DERR_RECREATE_TARGET so
+ // abandon this paint to avoid further failures.
+ // Main drawing surface and pixmaps should be recreated by next paint.
+ return;
+ }
if (!view.bufferedDraw)
surfaceWindow->SetClip(rcArea);