From d0b6642abddda460c63b99223f062cbd8209f522 Mon Sep 17 00:00:00 2001 From: Lucas Murray Date: Wed, 4 Feb 2009 06:48:25 +0000 Subject: [PATCH] Prevent the fade effect from constantly issuing repaint requests when it is not needed. Prevents desktop grid excessive CPU usage. CCBUG: 182997 svn path=/trunk/KDE/kdebase/workspace/; revision=920960 --- effects/fade.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/effects/fade.cpp b/effects/fade.cpp index e376fd5172..47a2c15d9e 100644 --- a/effects/fade.cpp +++ b/effects/fade.cpp @@ -42,8 +42,11 @@ void FadeEffect::reconfigure( ReconfigureFlags ) // Add all existing windows to the window list // TODO: Enabling desktop effects should trigger windowAdded() on all windows windows.clear(); + if( !fadeWindows ) + return; foreach( EffectWindow *w, effects->stackingOrder() ) - windows[ w ].opacity = 1.0; + if( w && isFadeWindow( w )) // TODO: Apparently w can == NULL here? + windows[ w ] = WindowInfo(); } void FadeEffect::prePaintScreen( ScreenPrePaintData& data, int time ) @@ -76,7 +79,7 @@ void FadeEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data, int } } effects->prePaintWindow( w, data, time ); - if( windows.contains( w ) && !w->isPaintingEnabled()) + if( windows.contains( w ) && !w->isPaintingEnabled() && !effects->activeFullScreenEffect() ) { // if the window isn't to be painted, then let's make sure // to track its progress if( windows[ w ].fadeInStep < 1.0