Commit 50f0df8f authored by David Edmundson's avatar David Edmundson Committed by Vlad Zahorodnii
Browse files

Fix flickering in slide effect with multi screen

The slide effect translates all windows as we switch desktop. In a multi
screen setup we don't want windows to enter a different screen during
this animation.

The current code masks everything to the current output. This is broken
for any window that spans across screens even slightly. It will not be
visible during the transform then appear on top at the end.

The new algorithm is, for each screen in each window we crop the painted
area to the intersection of the screen and the screen's translated
position.


(cherry picked from commit df1938b8)
parent a782d18c
Pipeline #200785 passed with stage
in 23 minutes and 44 seconds
......@@ -282,16 +282,20 @@ void SlideEffect::paintWindow(EffectWindow *w, int mask, QRegion region, WindowP
}
for (EffectScreen *screen : effects->screens()) {
QPoint translation = getDrawCoords(m_paintCtx.translation, screen);
QPoint translation;
if (isTranslated(w)) {
translation = getDrawCoords(m_paintCtx.translation, screen);
data += translation;
}
const QRect screenArea = screen->geometry();
const QRect croppedScreenArea = screenArea.translated(translation).intersected(screenArea);
effects->paintWindow(
w,
mask,
// Only paint the region that intersects the current screen and desktop.
region.intersected(effects->clientArea(ScreenArea, w)).intersected(effects->clientArea(ScreenArea, screen, effects->currentDesktop())),
region.intersected(croppedScreenArea),
data);
if (isTranslated(w)) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment