diff --git a/composite.cpp b/composite.cpp index 5ffae47277..25859793da 100644 --- a/composite.cpp +++ b/composite.cpp @@ -372,14 +372,20 @@ void Workspace::setupOverlay( Window w ) assert( Extensions::shapeInputAvailable()); XShapeCombineRectangles( display(), overlay, ShapeInput, 0, 0, NULL, 0, ShapeSet, Unsorted ); if( w != None ) - { XShapeCombineRectangles( display(), w, ShapeInput, 0, 0, NULL, 0, ShapeSet, Unsorted ); - XMapWindow( display(), w ); - } - XMapRaised( display(), overlay ); XSelectInput( display(), overlay, VisibilityChangeMask ); } +void Workspace::showOverlay() + { + assert( overlay != None ); + if( overlay_shown ) + return; + XMapSubwindows( display(), overlay ); + XMapWindow( display(), overlay ); + overlay_shown = true; + } + void Workspace::destroyOverlay() { if( overlay == None ) @@ -388,6 +394,7 @@ void Workspace::destroyOverlay() XCompositeReleaseOverlayWindow( display(), overlay ); #endif overlay = None; + overlay_shown = false; } //**************************************** diff --git a/scene_opengl.cpp b/scene_opengl.cpp index 92ec98ffd5..5e6db2324f 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -638,6 +638,8 @@ void SceneOpenGL::waitSync() // actually paint to the screen (double-buffer swap or copy from pixmap buffer) void SceneOpenGL::flushBuffer( int mask, QRegion damage ) { + if( wspace->overlayWindow()) // show the window only after the first pass, since + wspace->showOverlay(); // that pass may take long if( db ) { if( mask & PAINT_SCREEN_REGION ) diff --git a/scene_xrender.cpp b/scene_xrender.cpp index 097155ea51..ede5d47ad4 100644 --- a/scene_xrender.cpp +++ b/scene_xrender.cpp @@ -170,6 +170,8 @@ void SceneXrender::paint( QRegion damage, ToplevelList toplevels ) } int mask = 0; paintScreen( &mask, &damage ); + if( wspace->overlayWindow()) // show the window only after the first pass, since + wspace->showOverlay(); // that pass may take long if( mask & PAINT_SCREEN_REGION ) { // Use the damage region as the clip region for the root window diff --git a/workspace.cpp b/workspace.cpp index b9965c2ab1..35ef19fd49 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -137,6 +137,7 @@ Workspace::Workspace( bool restore ) compositeRate( 0 ), overlay( None ), overlay_visible( true ), + overlay_shown( false ), transSlider( NULL ), transButton( NULL ) { diff --git a/workspace.h b/workspace.h index 814bb135c6..2bcbcaa19d 100644 --- a/workspace.h +++ b/workspace.h @@ -318,6 +318,7 @@ class Workspace : public QObject, public KDecorationDefines bool createOverlay(); // init overlay and the destination window in it void setupOverlay( Window window ); + void showOverlay(); // destroys XComposite overlay window void destroyOverlay(); Window overlayWindow(); @@ -723,6 +724,7 @@ class Workspace : public QObject, public KDecorationDefines QRegion repaints_region; Window overlay; // XComposite overlay window bool overlay_visible; + bool overlay_shown; // for showOverlay() QSlider *transSlider; QPushButton *transButton;