[effects/cubeslide] Cancel active animation when number of desktops has changed
Summary: If a virtual desktop is removed, then desktopChanged will be followed by numberDesktopsChanged signal. In which case, we have to cancel the active animation because front_desktop might be no longer valid when it's time to perform compositing. BUG: 406452 Reviewers: #kwin, davidedmundson Reviewed By: #kwin, davidedmundson Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D21064
This commit is contained in:
parent
c438ecbb70
commit
e8b45cce11
2 changed files with 25 additions and 0 deletions
|
@ -49,6 +49,8 @@ CubeSlideEffect::CubeSlideEffect()
|
|||
this, &CubeSlideEffect::slotWindowStepUserMovedResized);
|
||||
connect(effects, &EffectsHandler::windowFinishUserMovedResized,
|
||||
this, &CubeSlideEffect::slotWindowFinishUserMovedResized);
|
||||
connect(effects, &EffectsHandler::numberDesktopsChanged,
|
||||
this, &CubeSlideEffect::slotNumberDesktopsChanged);
|
||||
reconfigure(ReconfigureAll);
|
||||
}
|
||||
|
||||
|
@ -644,4 +646,26 @@ bool CubeSlideEffect::isActive() const
|
|||
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
|
||||
|
|
|
@ -78,6 +78,7 @@ private Q_SLOTS:
|
|||
void slotDesktopChanged(int old, int current, EffectWindow* w);
|
||||
void slotWindowStepUserMovedResized(KWin::EffectWindow *w);
|
||||
void slotWindowFinishUserMovedResized(KWin::EffectWindow *w);
|
||||
void slotNumberDesktopsChanged();
|
||||
|
||||
private:
|
||||
enum RotationDirection {
|
||||
|
|
Loading…
Reference in a new issue