diff --git a/effects/slidingpopups/slidingpopups.cpp b/effects/slidingpopups/slidingpopups.cpp index a104a5c5a9..066b2a3287 100644 --- a/effects/slidingpopups/slidingpopups.cpp +++ b/effects/slidingpopups/slidingpopups.cpp @@ -3,6 +3,7 @@ This file is part of the KDE project. Copyright (C) 2009 Marco Martin notmart@gmail.com +Copyright (C) 2018 Vlad Zagorodniy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -53,6 +54,11 @@ SlidingPopupsEffect::SlidingPopupsEffect() m_atom = effects->announceSupportProperty(QByteArrayLiteral("_KDE_SLIDE"), this); } ); + connect(effects, qOverload(&EffectsHandler::desktopChanged), + this, &SlidingPopupsEffect::stopAnimations); + connect(effects, &EffectsHandler::activeFullScreenEffectChanged, + this, &SlidingPopupsEffect::stopAnimations); + reconfigure(ReconfigureAll); } @@ -434,6 +440,22 @@ void SlidingPopupsEffect::slideOut(EffectWindow *w) w->addRepaintFull(); } +void SlidingPopupsEffect::stopAnimations() +{ + for (auto it = m_animations.constBegin(); it != m_animations.constEnd(); ++it) { + EffectWindow *w = it.key(); + + if (w->isDeleted()) { + w->unrefWindow(); + } else { + w->setData(WindowForceBackgroundContrastRole, QVariant()); + w->setData(WindowForceBlurRole, QVariant()); + } + } + + m_animations.clear(); +} + bool SlidingPopupsEffect::isActive() const { return !m_animations.isEmpty(); diff --git a/effects/slidingpopups/slidingpopups.h b/effects/slidingpopups/slidingpopups.h index 821640af77..32e8fb5761 100644 --- a/effects/slidingpopups/slidingpopups.h +++ b/effects/slidingpopups/slidingpopups.h @@ -3,6 +3,7 @@ This file is part of the KDE project. Copyright (C) 2009 Marco Martin notmart@gmail.com +Copyright (C) 2018 Vlad Zagorodniy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -49,8 +50,6 @@ public: static bool supported(); - // TODO react also on virtual desktop changes - int slideInDuration() const; int slideOutDuration() const; @@ -62,6 +61,7 @@ private Q_SLOTS: void slideIn(EffectWindow *w); void slideOut(EffectWindow *w); + void stopAnimations(); private: void setupAnimData(EffectWindow *w); @@ -81,7 +81,7 @@ private: AnimationKind kind; TimeLine timeLine; }; - QHash m_animations; + QHash m_animations; enum class Location { Left,