diff --git a/composite.cpp b/composite.cpp index 3895b61c97..d93c8c8ad5 100644 --- a/composite.cpp +++ b/composite.cpp @@ -309,6 +309,9 @@ void Toplevel::addDamage( int x, int y, int w, int h ) if( !compositing()) return; QRect r( x, y, w, h ); + // resizing the decoration may lag behind a bit and when shrinking there + // may be a damage event coming with size larger than the current window size + r &= rect(); damage_region += r; r.translate( this->x(), this->y()); // this could be possibly optimized to damage Workspace only if the toplevel @@ -319,6 +322,7 @@ void Toplevel::addDamage( int x, int y, int w, int h ) void Toplevel::addDamageFull() { + damage_region = QRegion(); // first reset e.g. in case of shrinking addDamage( rect()); } diff --git a/events.cpp b/events.cpp index 446eaae44f..b231958249 100644 --- a/events.cpp +++ b/events.cpp @@ -1628,6 +1628,7 @@ bool Unmanaged::windowEvent( XEvent* e ) if( e->type == Extensions::shapeNotifyEvent() ) { detectShape( handle()); + addDamageFull(); if( scene != NULL ) scene->windowGeometryShapeChanged( this ); }