diff --git a/effects.cpp b/effects.cpp index 3b9fef3b11..c0886442ea 100644 --- a/effects.cpp +++ b/effects.cpp @@ -1381,9 +1381,9 @@ double EffectWindowImpl::shadowSaturation( ShadowType type ) const return toplevel->workspace()->decorationShadowSaturation( type ); } -WindowQuadList EffectWindowImpl::buildQuads() const +WindowQuadList EffectWindowImpl::buildQuads( bool force ) const { - return sceneWindow()->buildQuads(); + return sceneWindow()->buildQuads( force ); } EffectWindow* effectWindow( Toplevel* w ) diff --git a/effects.h b/effects.h index 66f4fa3811..f00f87d378 100644 --- a/effects.h +++ b/effects.h @@ -243,7 +243,7 @@ class EffectWindowImpl : public EffectWindow virtual double shadowBrightness( ShadowType type ) const; virtual double shadowSaturation( ShadowType type ) const; - virtual WindowQuadList buildQuads() const; + virtual WindowQuadList buildQuads( bool force = false ) const; const Toplevel* window() const; Toplevel* window(); diff --git a/effects/shadow.cpp b/effects/shadow.cpp index b239d24b4a..54d5c78111 100644 --- a/effects/shadow.cpp +++ b/effects/shadow.cpp @@ -138,6 +138,9 @@ void ShadowEffect::reconfigure( ReconfigureFlags ) updateShadowColor(); // Load decoration shadow related things + bool reconfiguring = false; + if( mShadowQuadTypes.count() ) + reconfiguring = true; mShadowQuadTypes.clear(); // Changed decoration? TODO: Unregister? #ifdef KWIN_HAVE_OPENGL_COMPOSITING if( effects->compositingType() == OpenGLCompositing ) @@ -178,6 +181,12 @@ void ShadowEffect::reconfigure( ReconfigureFlags ) } } #endif + + if( reconfiguring ) + { // Force rebuild of all quads to clear their caches + foreach( EffectWindow *w, effects->stackingOrder() ) + w->buildQuads( true ); + } } void ShadowEffect::updateShadowColor() diff --git a/lib/kwineffects.h b/lib/kwineffects.h index 3c412d69de..d51a30e9ae 100644 --- a/lib/kwineffects.h +++ b/lib/kwineffects.h @@ -837,9 +837,10 @@ class KWIN_EXPORT EffectWindow * Returns the desired saturation of the shadow. */ virtual double shadowSaturation( ShadowType type ) const = 0; - - // TODO internal? - virtual WindowQuadList buildQuads() const = 0; + /** + * Returns the unmodified window quad list. Can also be used to force rebuilding. + */ + virtual WindowQuadList buildQuads( bool force = false ) const = 0; }; class KWIN_EXPORT EffectWindowGroup diff --git a/scene.cpp b/scene.cpp index da7247aa39..15becfd306 100644 --- a/scene.cpp +++ b/scene.cpp @@ -447,9 +447,9 @@ void Scene::Window::disablePainting( int reason ) disable_painting |= reason; } -WindowQuadList Scene::Window::buildQuads() const +WindowQuadList Scene::Window::buildQuads( bool force ) const { - if( cached_quad_list != NULL ) + if( cached_quad_list != NULL && !force ) return *cached_quad_list; WindowQuadList ret; if( toplevel->clientPos() == QPoint( 0, 0 ) && toplevel->clientSize() == toplevel->size()) diff --git a/scene.h b/scene.h index aeb090b838..680e3433a8 100644 --- a/scene.h +++ b/scene.h @@ -182,7 +182,7 @@ class Scene::Window void discardShape(); void updateToplevel( Toplevel* c ); // creates initial quad list for the window - virtual WindowQuadList buildQuads() const; + virtual WindowQuadList buildQuads( bool force = false ) const; void suspendUnredirect( bool suspend ); protected: WindowQuadList makeQuads( WindowQuadType type, const QRegion& reg ) const;