aboutsummaryrefslogtreecommitdiffhomepage
path: root/gtk
diff options
context:
space:
mode:
authorMitchell Foral <unknown>2022-02-16 09:32:20 +1100
committerMitchell Foral <unknown>2022-02-16 09:32:20 +1100
commit5f97894b40d40d8f4cbb3196cfadb25ccc131bc4 (patch)
tree22d4c94df0bcf2b171da98d48965a4d93b9e1d30 /gtk
parent226a1eaead24119716a6a2e13558a9b018e5aa0b (diff)
downloadscintilla-mirror-5f97894b40d40d8f4cbb3196cfadb25ccc131bc4.tar.gz
Fix re-entrant painting to maintain update region.
Diffstat (limited to 'gtk')
-rwxr-xr-xgtk/ScintillaGTK.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx
index bc6402e30..dd22dcbc9 100755
--- a/gtk/ScintillaGTK.cxx
+++ b/gtk/ScintillaGTK.cxx
@@ -2656,13 +2656,13 @@ gboolean ScintillaGTK::DrawTextThis(cairo_t *cr) {
rcPaint = GetClientRectangle();
- PLATFORM_ASSERT(rgnUpdate == nullptr);
+ cairo_rectangle_list_t *oldRgnUpdate = rgnUpdate;
rgnUpdate = cairo_copy_clip_rectangle_list(cr);
if (rgnUpdate && rgnUpdate->status != CAIRO_STATUS_SUCCESS) {
// If not successful then ignore
fprintf(stderr, "DrawTextThis failed to copy update region %d [%d]\n", rgnUpdate->status, rgnUpdate->num_rectangles);
cairo_rectangle_list_destroy(rgnUpdate);
- rgnUpdate = 0;
+ rgnUpdate = nullptr;
}
double x1, y1, x2, y2;
@@ -2687,7 +2687,7 @@ gboolean ScintillaGTK::DrawTextThis(cairo_t *cr) {
if (rgnUpdate) {
cairo_rectangle_list_destroy(rgnUpdate);
}
- rgnUpdate = 0;
+ rgnUpdate = oldRgnUpdate;
paintState = PaintState::notPainting;
} catch (...) {
errorStatus = Status::Failure;
@@ -2759,7 +2759,7 @@ gboolean ScintillaGTK::ExposeTextThis(GtkWidget * /*widget*/, GdkEventExpose *os
ose->area.x + ose->area.width,
ose->area.y + ose->area.height);
- PLATFORM_ASSERT(rgnUpdate == nullptr);
+ GdkRegion *oldRgnUpdate = rgnUpdate;
rgnUpdate = gdk_region_copy(ose->region);
const PRectangle rcClient = GetClientRectangle();
paintingAllText = rcPaint.Contains(rcClient);
@@ -2779,7 +2779,7 @@ gboolean ScintillaGTK::ExposeTextThis(GtkWidget * /*widget*/, GdkEventExpose *os
if (rgnUpdate) {
gdk_region_destroy(rgnUpdate);
}
- rgnUpdate = nullptr;
+ rgnUpdate = oldRgnUpdate;
} catch (...) {
errorStatus = Status::Failure;
}