diff --git a/scene.cpp b/scene.cpp index 28282ea5cd..a9b8bd438a 100644 --- a/scene.cpp +++ b/scene.cpp @@ -111,8 +111,12 @@ void Scene::paintScreen( int* mask, QRegion* region ) *mask &= ~PAINT_SCREEN_REGION; *region = infiniteRegion(); } - else if(( *mask & PAINT_SCREEN_REGION ) == 0 ) - { // force region to be full + else if( *mask & PAINT_SCREEN_REGION ) + { // make sure not to go outside visible screen + *region &= QRegion( 0, 0, displayWidth(), displayHeight()); + } + else + { // whole screen, not transformed, force region to be full *region = QRegion( 0, 0, displayWidth(), displayHeight()); } ScreenPaintData data; diff --git a/scene_opengl.cpp b/scene_opengl.cpp index 8850f85ac5..2fcea9a23c 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -467,8 +467,10 @@ void SceneOpenGL::waitSync() } // actually paint to the screen (double-buffer swap or copy from pixmap buffer) -void SceneOpenGL::flushBuffer( int mask, const QRegion& damage ) +void SceneOpenGL::flushBuffer( int mask, QRegion damage ) { + if( mask & PAINT_SCREEN_REGION )// make sure not to go outside visible screen + damage &= QRegion( 0, 0, displayWidth(), displayHeight()); if( db ) { if( mask & PAINT_SCREEN_REGION ) diff --git a/scene_opengl.h b/scene_opengl.h index e21b9352e5..8644ab84ea 100644 --- a/scene_opengl.h +++ b/scene_opengl.h @@ -45,7 +45,7 @@ class SceneOpenGL void initRenderingContext(); bool findConfig( const int* attrs, GLXFBConfig* config, VisualID visual = None ); void waitSync(); - void flushBuffer( int mask, const QRegion& damage ); + void flushBuffer( int mask, QRegion damage ); typedef GLuint Texture; GC gcroot; Drawable buffer;