diff --git a/effects/slide/slide.h b/effects/slide/slide.h --- a/effects/slide/slide.h +++ b/effects/slide/slide.h @@ -50,10 +50,11 @@ static bool supported(); private Q_SLOTS: - void slotDesktopChanged(int old, int current); + void slotDesktopChanged(int old, int current, KWin::EffectWindow* with); private: void windowAdded(EffectWindow* w); + void windowDeleted(EffectWindow* w); bool shouldForceBackgroundContrast(const EffectWindow* w) const; QList< EffectWindow* > m_backgroundContrastForcedBefore; QRect desktopRect(int desktop) const; @@ -64,6 +65,7 @@ bool slide_painting_sticky; bool slide_painting_keep_above; QPoint slide_painting_diff; + EffectWindow* m_movingWindow = nullptr; }; diff --git a/effects/slide/slide.cpp b/effects/slide/slide.cpp --- a/effects/slide/slide.cpp +++ b/effects/slide/slide.cpp @@ -32,11 +32,10 @@ : slide(false) { initConfig(); - connect(effects, SIGNAL(desktopChanged(int,int)), this, SLOT(slotDesktopChanged(int,int))); + connect(effects, SIGNAL(desktopChanged(int,int,KWin::EffectWindow*)), + this, SLOT(slotDesktopChanged(int,int,KWin::EffectWindow*))); connect(effects, &EffectsHandler::windowAdded, this, &SlideEffect::windowAdded); - connect(effects, &EffectsHandler::windowDeleted, this, [this](EffectWindow *w) { - m_backgroundContrastForcedBefore.removeAll(w); - }); + connect(effects, &EffectsHandler::windowDeleted, this, &SlideEffect::windowDeleted); mTimeLine.setCurveShape(QTimeLine::EaseInOutCurve); reconfigure(ReconfigureAll); } @@ -72,6 +71,7 @@ } } m_backgroundContrastForcedBefore.clear(); + m_movingWindow = nullptr; slide = false; mTimeLine.setCurrentTime(0); effects->setActiveFullScreenEffect(NULL); @@ -82,7 +82,7 @@ void SlideEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time) { - if (slide) { + if (slide && w != m_movingWindow) { if (w->isOnAllDesktops()) { bool keep_above = w->keepAbove() || w->isDock(); if ((!slide_painting_sticky || keep_above) && @@ -182,8 +182,8 @@ void SlideEffect::paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data) { if (slide) { - // don't move windows on all desktops (compensate screen transformation) - if (!w->isOnAllDesktops()) { // TODO also fix 'Workspace::movingClient' + // Do not move a window if it is on all desktops or being moved to another desktop. + if (!w->isOnAllDesktops() && w != m_movingWindow) { data += slide_painting_diff; } } @@ -205,7 +205,7 @@ return rect; } -void SlideEffect::slotDesktopChanged(int old, int current) +void SlideEffect::slotDesktopChanged(int old, int current, EffectWindow* with) { if (effects->activeFullScreenEffect() && effects->activeFullScreenEffect() != this) return; @@ -275,6 +275,9 @@ } effects->setActiveFullScreenEffect(this); } + + m_movingWindow = with; + effects->addRepaintFull(); } @@ -286,6 +289,13 @@ } } +void SlideEffect::windowDeleted(EffectWindow *w) +{ + m_backgroundContrastForcedBefore.removeAll(w); + if (w == m_movingWindow) + m_movingWindow = nullptr; +} + bool SlideEffect::shouldForceBackgroundContrast(const EffectWindow *w) const { // Windows that are docks, kept above (such as panel popups), and do not