diff --git a/effects/fade/CMakeLists.txt b/effects/fade/CMakeLists.txt index 865afb7560..c79b8f063e 100644 --- a/effects/fade/CMakeLists.txt +++ b/effects/fade/CMakeLists.txt @@ -4,6 +4,7 @@ # Source files set( kwin4_effect_builtins_sources ${kwin4_effect_builtins_sources} fade/fade.cpp + fade/fade_proxy.cpp ) # .desktop files diff --git a/effects/fade/fade.cpp b/effects/fade/fade.cpp index 47a2c15d9e..8d70266ff9 100644 --- a/effects/fade/fade.cpp +++ b/effects/fade/fade.cpp @@ -28,10 +28,16 @@ namespace KWin KWIN_EFFECT( fade, FadeEffect ) FadeEffect::FadeEffect() + : m_proxy( this ) { reconfigure( ReconfigureAll ); } +const void* FadeEffect::proxy() const + { + return &m_proxy; + } + void FadeEffect::reconfigure( ReconfigureFlags ) { KConfigGroup conf = effects->effectConfig( "Fade" ); @@ -195,10 +201,23 @@ void FadeEffect::windowDeleted( EffectWindow* w ) windows.remove( w ); } +void FadeEffect::setWindowIgnored( EffectWindow* w, bool ignore ) +{ + if (ignore) + { + ignoredWindows.insert( w ); + } + else + { + ignoredWindows.remove( w ); + } +} + bool FadeEffect::isFadeWindow( EffectWindow* w ) { if( w->windowClass() == "ksplashx ksplashx" - || w->windowClass() == "ksplashsimple ksplashsimple" ) + || w->windowClass() == "ksplashsimple ksplashsimple" + || ignoredWindows.contains( w ) ) { // see login effect return false; } diff --git a/effects/fade/fade.h b/effects/fade/fade.h index 48b100e638..f4dcdd6532 100644 --- a/effects/fade/fade.h +++ b/effects/fade/fade.h @@ -21,6 +21,8 @@ along with this program. If not, see . #ifndef KWIN_FADE_H #define KWIN_FADE_H +#include "fade_proxy.h" + #include namespace KWin @@ -41,14 +43,19 @@ class FadeEffect virtual void windowAdded( EffectWindow* c ); virtual void windowClosed( EffectWindow* c ); virtual void windowDeleted( EffectWindow* c ); + virtual const void* proxy() const; + + void setWindowIgnored( EffectWindow* w, bool ignore ); bool isFadeWindow( EffectWindow* w ); private: class WindowInfo; QHash< const EffectWindow*, WindowInfo > windows; + QSet< const EffectWindow* > ignoredWindows; double fadeInStep, fadeOutStep; int fadeInTime, fadeOutTime; bool fadeWindows; + FadeEffectProxy m_proxy; }; class FadeEffect::WindowInfo diff --git a/effects/shadow/shadow.cpp b/effects/shadow/shadow.cpp index b8597d2584..8a5ce411fb 100644 --- a/effects/shadow/shadow.cpp +++ b/effects/shadow/shadow.cpp @@ -369,9 +369,9 @@ void ShadowEffect::windowClosed( EffectWindow* c ) bool ShadowEffect::useShadow( EffectWindow* w ) const { - return !w->isDeleted() && !w->isDesktop() && !w->isDock() - // popups may have shadow even if shaped, their shape is almost rectangular - && ( !w->hasOwnShape() || w->isDropdownMenu() || w->isPopupMenu() || w->isComboBox()) + return !w->isDeleted() && !w->isDesktop() + // popups and docks may have shadow even if shaped, their shape is almost rectangular + && ( !w->hasOwnShape() || w->isDropdownMenu() || w->isPopupMenu() || w->isComboBox() || w->isDock()) // If decoration has it's own shadow leave it alone && !( w->hasDecoration() && effects->hasDecorationShadows() ); } diff --git a/effects/slidingpopups/slidingpopups.cpp b/effects/slidingpopups/slidingpopups.cpp index 78f89cabde..1ba94cb570 100644 --- a/effects/slidingpopups/slidingpopups.cpp +++ b/effects/slidingpopups/slidingpopups.cpp @@ -20,6 +20,8 @@ along with this program. If not, see . #include "slidingpopups.h" +#include "../fade/fade_proxy.h" + #include namespace KWin @@ -85,7 +87,6 @@ void SlidingPopupsEffect::paintWindow( EffectWindow* w, int mask, QRegion region bool animating = false; bool appearing = false; QRegion clippedRegion = region; - data.opacity = 1.0; if( mAppearingWindows.contains( w ) ) { @@ -107,20 +108,20 @@ void SlidingPopupsEffect::paintWindow( EffectWindow* w, int mask, QRegion region { case West: data.xTranslate += (start - w->width()) * progress; - clippedRegion = clippedRegion.subtracted(QRegion(start - w->width(), w->y(), w->width(), w->height())); + clippedRegion = clippedRegion.subtracted(QRegion(start - w->width(), w->y(), w->width(), w->height() ) ); break; case North: data.yTranslate += (start - w->height()) * progress; - clippedRegion = clippedRegion.subtracted(QRegion(w->x(), start - w->height(), w->width(), w->height())); + clippedRegion = clippedRegion.subtracted(QRegion( w->x(), start - w->height(), w->width(), w->height() ) ); break; case East: data.xTranslate += (start - w->x()) * progress; - clippedRegion = clippedRegion.subtracted(QRegion(w->x()+w->width(), w->y(), w->width(), w->height())); + clippedRegion = clippedRegion.subtracted(QRegion( w->x()+w->width(), w->y(), w->width(), w->height() ) ); break; case South: default: data.yTranslate += (start - w->y()) * progress; - clippedRegion = clippedRegion.subtracted(QRegion(w->x(), start, w->width(), w->height())); + clippedRegion = clippedRegion.subtracted(QRegion( w->x(), start, w->width(), w->height() ) ); } } @@ -139,10 +140,16 @@ void SlidingPopupsEffect::windowAdded( EffectWindow* w ) propertyNotify( w, mAtom ); if( w->isOnCurrentDesktop() && mWindowsData.contains( w ) ) { - mAppearingWindows[ w ].setDuration( animationTime( mFadeInTime )); + mAppearingWindows[ w ].setDuration( animationTime( mFadeInTime ) ); mAppearingWindows[ w ].setProgress( 0.0 ); mAppearingWindows[ w ].setCurveShape( TimeLine::EaseOutCurve ); + //tell fadeto ignore this window + const FadeEffectProxy* proxy = + static_cast( effects->getProxy( "fade" ) ); + if( proxy ) + ((FadeEffectProxy*)proxy)->setWindowIgnored( w, true ); + w->addRepaintFull(); } } diff --git a/effects/slidingpopups/slidingpopups.desktop b/effects/slidingpopups/slidingpopups.desktop index 037c54bd4d..a396af286c 100644 --- a/effects/slidingpopups/slidingpopups.desktop +++ b/effects/slidingpopups/slidingpopups.desktop @@ -39,4 +39,4 @@ X-KDE-PluginInfo-Depends= X-KDE-PluginInfo-License=GPL X-KDE-PluginInfo-EnabledByDefault=true X-KDE-Library=kwin4_effect_builtins -X-KDE-Ordering=70 +X-KDE-Ordering=50