[wayland] Ensure that repaints_region is in frame-local coordinates

Summary:
The repaints region is in frame-local coordinates, i.e. relative to the
top-left corner of the frame geometry.

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: davidedmundson, kwin

Tags: #kwin

Maniphest Tasks: T10867

Differential Revision: https://phabricator.kde.org/D24457
This commit is contained in:
Vlad Zahorodnii 2019-09-29 11:44:47 +03:00
parent 038509e603
commit 85777aaac2

View file

@ -389,7 +389,10 @@ void XdgShellClient::setOpacity(double opacity)
void XdgShellClient::addDamage(const QRegion &damage)
{
repaints_region += damage.translated(clientPos());
const int offsetX = m_bufferGeometry.x() - frameGeometry().x();
const int offsetY = m_bufferGeometry.y() - frameGeometry().y();
repaints_region += damage.translated(offsetX, offsetY);
Toplevel::addDamage(damage);
}