diff --git a/composite.cpp b/composite.cpp index 1438ce68de..a7a45905d8 100644 --- a/composite.cpp +++ b/composite.cpp @@ -409,9 +409,10 @@ void Workspace::setupOverlay( Window w ) assert( overlay != None ); assert( Extensions::shapeInputAvailable()); XSetWindowBackgroundPixmap( display(), overlay, None ); - XShapeCombineRectangles( display(), overlay, ShapeInput, 0, 0, NULL, 0, ShapeSet, Unsorted ); XRectangle rec = { 0, 0, displayWidth(), displayHeight() }; XShapeCombineRectangles( display(), overlay, ShapeBounding, 0, 0, &rec, 1, ShapeSet, Unsorted ); + XShapeCombineRectangles( display(), overlay, ShapeInput, 0, 0, NULL, 0, ShapeSet, Unsorted ); + overlay_shape = QRegion( 0, 0, displayWidth(), displayHeight()); if( w != None ) { XSetWindowBackgroundPixmap( display(), w, None ); @@ -488,6 +489,11 @@ void Workspace::delayedCheckUnredirect() if( c->unredirected()) reg -= c->geometry(); } + // Avoid setting the same shape again, it causes flicker (apparently it is not a no-op + // and triggers something). + if( reg == overlay_shape ) + return; + overlay_shape = reg; QVector< QRect > rects = reg.rects(); XRectangle* xrects = new XRectangle[ rects.count() ]; for( int i = 0; diff --git a/workspace.h b/workspace.h index b930797b9b..9b5f20be0c 100644 --- a/workspace.h +++ b/workspace.h @@ -739,6 +739,7 @@ class Workspace : public QObject, public KDecorationDefines Window overlay; // XComposite overlay window bool overlay_visible; bool overlay_shown; // for showOverlay() + QRegion overlay_shape; QSlider *transSlider; QPushButton *transButton; QTimer unredirectTimer;