diff --git a/effects/taskbarthumbnail/taskbarthumbnail.cpp b/effects/taskbarthumbnail/taskbarthumbnail.cpp index 02a309480b..956b15c123 100644 --- a/effects/taskbarthumbnail/taskbarthumbnail.cpp +++ b/effects/taskbarthumbnail/taskbarthumbnail.cpp @@ -53,22 +53,9 @@ void TaskbarThumbnailEffect::prePaintScreen( ScreenPrePaintData& data, int time // if( thumbnails.count() > 0 ) // // TODO this should not be needed (it causes whole screen repaint) // data.mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS; - - damagedWindows.clear(); - effects->prePaintScreen(data, time); } -void TaskbarThumbnailEffect::postPaintScreen() - { - // Update the thumbnail if the window was damaged - foreach( EffectWindow* w, thumbnails.keys() ) - foreach( const Data &thumb, thumbnails.values( w )) - if( damagedWindows.contains( effects->findWindow( thumb.window ))) - effects->addRepaint( thumb.rect.translated( w->pos() )); - effects->postPaintScreen(); - } - void TaskbarThumbnailEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data, int time ) { // TODO what if of the windows is translucent and one not? change data.mask? @@ -77,8 +64,6 @@ void TaskbarThumbnailEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData void TaskbarThumbnailEffect::paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data ) { - if( !( region & w->geometry() ).isEmpty() ) - damagedWindows.append( w ); // This window is damaged, TODO: Causes repaint loop if thumbnail covers window effects->paintWindow( w, mask, region, data ); // paint window first if( thumbnails.contains( w )) { // paint thumbnails on it @@ -102,6 +87,15 @@ void TaskbarThumbnailEffect::paintWindow( EffectWindow* w, int mask, QRegion reg } } +void TaskbarThumbnailEffect::windowDamaged( EffectWindow* w, const QRect& damage ) + { + // Update the thumbnail if the window was damaged + foreach( EffectWindow* window, thumbnails.keys() ) + foreach( const Data &thumb, thumbnails.values( window )) + if( w == effects->findWindow( thumb.window )) + effects->addRepaint( thumb.rect.translated( window->pos() )); + } + void TaskbarThumbnailEffect::windowAdded( EffectWindow* w ) { propertyNotify( w, atom ); // read initial value diff --git a/effects/taskbarthumbnail/taskbarthumbnail.h b/effects/taskbarthumbnail/taskbarthumbnail.h index 1bece045eb..aa419792a3 100644 --- a/effects/taskbarthumbnail/taskbarthumbnail.h +++ b/effects/taskbarthumbnail/taskbarthumbnail.h @@ -34,9 +34,9 @@ class TaskbarThumbnailEffect TaskbarThumbnailEffect(); virtual ~TaskbarThumbnailEffect(); virtual void prePaintScreen( ScreenPrePaintData& data, int time ); - virtual void postPaintScreen(); virtual void prePaintWindow( EffectWindow* w, WindowPrePaintData& data, int time ); virtual void paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data ); + virtual void windowDamaged( EffectWindow* w, const QRect& damage ); virtual void windowAdded( EffectWindow* w ); virtual void windowDeleted( EffectWindow* w ); virtual void propertyNotify( EffectWindow* w, long atom );