diff --git a/effects/cubeslide/cubeslide.h b/effects/cubeslide/cubeslide.h --- a/effects/cubeslide/cubeslide.h +++ b/effects/cubeslide/cubeslide.h @@ -78,6 +78,7 @@ void slotDesktopChanged(int old, int current, EffectWindow* w); void slotWindowStepUserMovedResized(KWin::EffectWindow *w); void slotWindowFinishUserMovedResized(KWin::EffectWindow *w); + void slotNumberDesktopsChanged(); private: enum RotationDirection { diff --git a/effects/cubeslide/cubeslide.cpp b/effects/cubeslide/cubeslide.cpp --- a/effects/cubeslide/cubeslide.cpp +++ b/effects/cubeslide/cubeslide.cpp @@ -49,6 +49,8 @@ this, &CubeSlideEffect::slotWindowStepUserMovedResized); connect(effects, &EffectsHandler::windowFinishUserMovedResized, this, &CubeSlideEffect::slotWindowFinishUserMovedResized); + connect(effects, &EffectsHandler::numberDesktopsChanged, + this, &CubeSlideEffect::slotNumberDesktopsChanged); reconfigure(ReconfigureAll); } @@ -644,4 +646,26 @@ return !slideRotations.isEmpty(); } +void CubeSlideEffect::slotNumberDesktopsChanged() +{ + // This effect animates only aftermaths of desktop switching. There is no any + // way to reference removed desktops for animation purposes. So our the best + // shot is just to do nothing. It doesn't look nice and we probaby have to + // find more proper way to handle this case. + + if (!isActive()) { + return; + } + + for (EffectWindow *w : staticWindows) { + w->setData(WindowForceBlurRole, QVariant()); + w->setData(WindowForceBackgroundContrastRole, QVariant()); + } + + slideRotations.clear(); + staticWindows.clear(); + + effects->setActiveFullScreenEffect(nullptr); +} + } // namespace