Schedule correct damage and repaints region in addDamageFull for csd clients

Summary:
The damage region is in surface-local coordinates, while 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: romangg, kwin

Tags: #kwin

Maniphest Tasks: T10867

Differential Revision: https://phabricator.kde.org/D24460
This commit is contained in:
Vlad Zahorodnii 2019-09-30 12:28:07 +03:00
parent 28b3b8f0d0
commit 0394f58101

View file

@ -419,10 +419,18 @@ void Toplevel::addDamageFull()
if (!compositing())
return;
damage_region = rect();
repaints_region |= rect();
const QRect bufferRect = bufferGeometry();
const QRect frameRect = frameGeometry();
emit damaged(this, rect());
const int offsetX = bufferRect.x() - frameRect.x();
const int offsetY = bufferRect.y() - frameRect.y();
const QRect damagedRect = QRect(0, 0, bufferRect.width(), bufferRect.height());
damage_region = damagedRect;
repaints_region |= damagedRect.translated(offsetX, offsetY);
emit damaged(this, damagedRect);
}
void Toplevel::resetDamage()