From 19a9dd4095305164614138cd1d5670b0c49d2c23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Thu, 28 Aug 2008 20:43:40 +0000 Subject: [PATCH] Fix the flicker caused by unredirecting code - apparently setting the same shape with X is not a no-op. svn path=/trunk/KDE/kdebase/workspace/; revision=854107 --- composite.cpp | 8 +++++++- workspace.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) 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;