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
This commit is contained in:
Luboš Luňák 2008-08-28 20:43:40 +00:00
parent 15ff73fabb
commit 19a9dd4095
2 changed files with 8 additions and 1 deletions

View file

@ -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;

View file

@ -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;