diff --git a/effects/slide/slide.h b/effects/slide/slide.h --- a/effects/slide/slide.h +++ b/effects/slide/slide.h @@ -86,6 +86,7 @@ int m_hGap; int m_vGap; bool m_slideDocks; + bool m_slideBackground; bool m_active = false; QTimeLine m_timeline; @@ -95,6 +96,7 @@ struct { int desktop; + bool firstPass; bool lastPass; QPoint translation; diff --git a/effects/slide/slide.cpp b/effects/slide/slide.cpp --- a/effects/slide/slide.cpp +++ b/effects/slide/slide.cpp @@ -71,6 +71,7 @@ m_hGap = SlideConfig::horizontalGap(); m_vGap = SlideConfig::verticalGap(); m_slideDocks = SlideConfig::slideDocks(); + m_slideBackground = SlideConfig::slideBackground(); } void SlideEffect::prePaintScreen(ScreenPrePaintData& data, int time) @@ -189,6 +190,7 @@ // passes, depending how an user moves between virtual desktops. // Windows, such as docks or keep-above windows, are painted in // the last pass so they are above other windows. + m_paintCtx.firstPass = true; const int lastDesktop = visibleDesktops.last(); for (int desktop : qAsConst(visibleDesktops)) { m_paintCtx.desktop = desktop; @@ -198,6 +200,7 @@ wrapDiff(m_paintCtx.translation, w, h); } effects->paintScreen(mask, region, data); + m_paintCtx.firstPass = false; } } @@ -211,7 +214,10 @@ if (w->isDock()) { return m_slideDocks; } - return w->isDesktop(); + if (w->isDesktop()) { + return m_slideBackground; + } + return false; } else if (w == m_movingWindow) { return false; } else if (w->isOnDesktop(m_paintCtx.desktop)) { @@ -239,6 +245,13 @@ } return true; } + if (w->isDesktop()) { + // If desktop background is not being slided, draw it only + // in the first pass. Otherwise, desktop backgrounds from + // follow-up virtual desktops will be drawn above windows + // from previous virtual desktops. + return m_slideBackground || m_paintCtx.firstPass; + } // In order to make sure that 'keep above' windows are above // other windows during transition to another virtual desktop, // they should be painted in the last pass. diff --git a/effects/slide/slide.kcfg b/effects/slide/slide.kcfg --- a/effects/slide/slide.kcfg +++ b/effects/slide/slide.kcfg @@ -18,5 +18,8 @@ true + + true + diff --git a/effects/slide/slide_config.ui b/effects/slide/slide_config.ui --- a/effects/slide/slide_config.ui +++ b/effects/slide/slide_config.ui @@ -106,6 +106,13 @@ + + + + Slide desktop background + + +