From 74a056e746e12a2efc6f8014047eeb20a759004b Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 18 Aug 2013 20:12:12 +0200 Subject: GUI: Clear dirty rects when initializing ThemeEngine. This avoids nasty invalid writes to the overlay when the overlay is being resized. --- gui/ThemeEngine.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gui') diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp index 561c0244a2..2abf4a545d 100644 --- a/gui/ThemeEngine.cpp +++ b/gui/ThemeEngine.cpp @@ -521,6 +521,12 @@ void ThemeEngine::setGraphicsMode(GraphicsMode mode) { delete _vectorRenderer; _vectorRenderer = Graphics::createRenderer(mode); _vectorRenderer->setSurface(&_screen); + + // Since we reinitialized our screen surfaces we know nothing has been + // drawn so far. Sometimes we still end up with dirty screen bits in the + // list. Clearing it avoids invalid overlay writes when the backend + // resizes the overlay. + _dirtyScreen.clear(); } void WidgetDrawData::calcBackgroundOffset() { -- cgit v1.2.3