diff --git a/bridge.cpp b/bridge.cpp index 7e666caed1..412c398e43 100644 --- a/bridge.cpp +++ b/bridge.cpp @@ -24,6 +24,8 @@ along with this program. If not, see . #include "options.h" #include "effects.h" +#include + namespace KWin { @@ -216,7 +218,10 @@ bool Bridge::shadowsActive() const if( !c->workspace()->compositingActive() ) return false; if( effects && static_cast( effects )->isEffectLoaded( "kwin4_effect_shadow" )) - return true; + { // The shadow effect has a setting to disable decoration shadows, take it into account. + KConfigGroup conf = static_cast( effects )->effectConfig( "Shadow" ); + return !conf.readEntry( "forceDecoratedToDefault", false ); + } return false; } diff --git a/effects/shadow.cpp b/effects/shadow.cpp index eb6f526d7c..7a0d22508b 100644 --- a/effects/shadow.cpp +++ b/effects/shadow.cpp @@ -74,6 +74,9 @@ void ShadowEffect::reconfigure( ReconfigureFlags ) shadowSize = conf.readEntry( "Size", 5 ); intensifyActiveShadow = conf.readEntry( "IntensifyActiveShadow", true ); updateShadowColor(); + forceDecorated = conf.readEntry( "forceDecoratedToDefault", false ); + forceUndecorated = conf.readEntry( "forceUndecoratedToDefault", false ); + forceOther = conf.readEntry( "forceOtherToDefault", false ); // Load decoration shadow related things bool reconfiguring = false; @@ -275,7 +278,7 @@ void ShadowEffect::buildQuads( EffectWindow* w, WindowQuadList& quadList ) // active and inactive shadows. Is implementing it worth // the performance drop? int id = 0; - if( w->hasDecoration() ) + if( w->hasDecoration() && !forceDecorated ) { // Decorated windows must be normal windows foreach( const QRect &r, w->shadowQuads( ShadowBorderedActive )) { @@ -288,7 +291,7 @@ void ShadowEffect::buildQuads( EffectWindow* w, WindowQuadList& quadList ) quadList.append( quad ); } } - else if( w->isNormalWindow() ) + else if( w->isNormalWindow() && !forceUndecorated ) { // No decoration on a normal window foreach( const QRect &r, w->shadowQuads( ShadowBorderlessActive )) { @@ -301,7 +304,7 @@ void ShadowEffect::buildQuads( EffectWindow* w, WindowQuadList& quadList ) quadList.append( quad ); } } - else + else if( !forceOther ) { // All other undecorated windows foreach( const QRect &r, w->shadowQuads( ShadowOther )) { diff --git a/effects/shadow.h b/effects/shadow.h index 22f58ab1ef..5076a7f3a9 100644 --- a/effects/shadow.h +++ b/effects/shadow.h @@ -69,6 +69,9 @@ class ShadowEffect int shadowSize; bool intensifyActiveShadow; QColor shadowColor; + bool forceDecorated; + bool forceUndecorated; + bool forceOther; #ifdef KWIN_HAVE_OPENGL_COMPOSITING QList< QList > mShadowTextures; QList mDefaultShadowTextures; diff --git a/effects/shadow_config.ui b/effects/shadow_config.ui index d9bb0393f3..b4ccf11dcd 100644 --- a/effects/shadow_config.ui +++ b/effects/shadow_config.ui @@ -262,9 +262,6 @@ - - false - Decoration Shadows