aboutsummaryrefslogtreecommitdiffhomepage
path: root/gtk/PlatGTK.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2014-06-16 11:20:32 +1000
committerNeil <nyamatongwe@gmail.com>2014-06-16 11:20:32 +1000
commit6fe552a1de2102dc1b097011a4b3b96b52842b31 (patch)
tree410633c474cb0e19f074b8abad5b3d4c47ba45c3 /gtk/PlatGTK.cxx
parent55aab4539ba8b897cb9a30c8303d0dd2a6f72c68 (diff)
downloadscintilla-mirror-6fe552a1de2102dc1b097011a4b3b96b52842b31.tar.gz
Fix crashes on Ubuntu 12.04 caused by overlay scrolll bar causing the drawing
surface to be finished.
Diffstat (limited to 'gtk/PlatGTK.cxx')
-rw-r--r--gtk/PlatGTK.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx
index c1e5566e5..d4572a912 100644
--- a/gtk/PlatGTK.cxx
+++ b/gtk/PlatGTK.cxx
@@ -527,6 +527,22 @@ void SurfaceImpl::Release() {
}
bool SurfaceImpl::Initialised() {
+ if (inited && context) {
+ if (cairo_status(context) == CAIRO_STATUS_SUCCESS) {
+ // Even when status is success, the target surface may have been
+ // finished whch may cause an assertion to fail crashing the application.
+ // The cairo_surface_has_show_text_glyphs call checks the finished flag
+ // and when set, sets the status to CAIRO_STATUS_SURFACE_FINISHED
+ // which leads to warning messages instead of crashes.
+ // Performing the check in this method as it is called rarely and has no
+ // other side effects.
+ cairo_surface_t *psurfContext = cairo_get_target(context);
+ if (psurfContext) {
+ cairo_surface_has_show_text_glyphs(psurfContext);
+ }
+ }
+ return cairo_status(context) == CAIRO_STATUS_SUCCESS;
+ }
return inited;
}