Fix repaints area on Wayland damage

The damage event of the Surface does not consider the offset through
the server side decoration. Due to that we need to have a different
repaint and damage area. As Toplevel::addDamage(QRegion) is only used
in the Wayland case the repaint adjustment is removed from the generic
implementation and moved into the specific implementations. While it
wouldn't hurt to have the repaint adjustment in Toplevel, it would
trigger a repaint of an unchanged area.

For Client I'm not sure whether it's correct without considering the
clientPos. My testing shows it's working, but that might also just be
do to Xwayland using OpenGL buffers. Needs further testing.
This commit is contained in:
Martin Gräßlin 2016-03-04 16:33:09 +01:00
parent 2c0df531b7
commit 34951b3bee
3 changed files with 2 additions and 1 deletions

View file

@ -2125,6 +2125,7 @@ void Client::addDamage(const QRegion &damage)
setupWindowManagementInterface();
}
}
repaints_region += damage;
Toplevel::addDamage(damage);
}

View file

@ -295,6 +295,7 @@ void ShellClient::addDamage(const QRegion &damage)
}
markAsMapped();
setDepth(m_shellSurface->surface()->buffer()->hasAlphaChannel() ? 32 : 24);
repaints_region += damage.translated(clientPos());
Toplevel::addDamage(damage);
}

View file

@ -462,7 +462,6 @@ void Toplevel::addDamage(const QRegion &damage)
{
m_isDamaged = true;
damage_region += damage;
repaints_region += damage;
for (const QRect &r : damage.rects()) {
emit damaged(this, r);
}