Commit c2ffcfdc authored by Vlad Zahorodnii's avatar Vlad Zahorodnii

[effects/wobblywindows] Fix visual artifacts caused by maximize effect

Summary:
If one wants to drag a maximized window while he or she has enabled both
the Wobbly Windows and the Maximize effect, visual artifacts can be
shown.

When the Maximize effect animates transition from maximize to restore,
some parts of the window can overshoot repaint regions(because of
wobbliness), leaving us with the visual artifacts.

To fix that, we have to take into account current scale and translation
when calculating dirty region in the Wobbly Windows effect.

BUG: 370612
FIXED-IN: 5.14.1

Test Plan: When dragging maximized windows, there are no visual artifacts anymore.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: abetts, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D15961
parent 5aeba9da
......@@ -326,8 +326,14 @@ void WobblyWindowsEffect::paintWindow(EffectWindow* w, int mask, QRegion region,
right = qMax(right, data.quads[i].right());
bottom = qMax(bottom, data.quads[i].bottom());
}
m_updateRegion = m_updateRegion.united(QRect(w->x() + left, w->y() + top,
right - left + 2, bottom - top + 2));
QRectF dirtyRect(
left * data.xScale() + w->x() + data.xTranslation(),
top * data.yScale() + w->y() + data.yTranslation(),
(right - left + 1.0) * data.xScale(),
(bottom - top + 1.0) * data.yScale());
// Expand the dirty region by 1px to fix potential round/floor issues.
dirtyRect.adjust(-1.0, -1.0, 1.0, 1.0);
m_updateRegion = m_updateRegion.united(dirtyRect.toRect());
}
// Call the next effect.
......
......@@ -54,7 +54,10 @@ public:
virtual bool isActive() const;
int requestedEffectChainPosition() const override {
return 45;
// Please notice that the Wobbly Windows effect has to be placed
// after the Maximize effect in the effect chain, otherwise there
// can be visual artifacts when dragging maximized windows.:wq
return 70;
}
// Wobbly model parameters
......
Markdown is supported
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