Don't let the damage region be larger than the window,
prevent painting errors when shrinking a window. svn path=/branches/work/kwin_composite/; revision=607510
This commit is contained in:
parent
277449f545
commit
d426d9dcd4
2 changed files with 5 additions and 0 deletions
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
|
@ -1628,6 +1628,7 @@ bool Unmanaged::windowEvent( XEvent* e )
|
|||
if( e->type == Extensions::shapeNotifyEvent() )
|
||||
{
|
||||
detectShape( handle());
|
||||
addDamageFull();
|
||||
if( scene != NULL )
|
||||
scene->windowGeometryShapeChanged( this );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue