From c54f34fb7c42c4e4b271ed6086e5790d7a97bf00 Mon Sep 17 00:00:00 2001 From: Neil Date: Mon, 16 Jun 2014 11:20:32 +1000 Subject: Fix crashes on Ubuntu 12.04 caused by overlay scrolll bar causing the drawing surface to be finished. --- src/Editor.cxx | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/Editor.cxx b/src/Editor.cxx index 63d45158b..18eafa271 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -1830,6 +1830,13 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) { RefreshStyleData(); RefreshPixMaps(surfWindow); + // On GTK+ with Ubuntu overlay scroll bars, the surface may have been finished + // at this point. The Initialised call checks for this case and sets the status + // to be bad which avoids crashes in following calls. + if (!surfWindow->Initialised()) { + return; + } + PRectangle rcMargin = GetClientRectangle(); Point ptOrigin = GetVisibleOriginInMain(); rcMargin.Move(0, -ptOrigin.y); -- cgit v1.2.3