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:
parent
2c0df531b7
commit
34951b3bee
3 changed files with 2 additions and 1 deletions
|
@ -2125,6 +2125,7 @@ void Client::addDamage(const QRegion &damage)
|
||||||
setupWindowManagementInterface();
|
setupWindowManagementInterface();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
repaints_region += damage;
|
||||||
Toplevel::addDamage(damage);
|
Toplevel::addDamage(damage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -295,6 +295,7 @@ void ShellClient::addDamage(const QRegion &damage)
|
||||||
}
|
}
|
||||||
markAsMapped();
|
markAsMapped();
|
||||||
setDepth(m_shellSurface->surface()->buffer()->hasAlphaChannel() ? 32 : 24);
|
setDepth(m_shellSurface->surface()->buffer()->hasAlphaChannel() ? 32 : 24);
|
||||||
|
repaints_region += damage.translated(clientPos());
|
||||||
Toplevel::addDamage(damage);
|
Toplevel::addDamage(damage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -462,7 +462,6 @@ void Toplevel::addDamage(const QRegion &damage)
|
||||||
{
|
{
|
||||||
m_isDamaged = true;
|
m_isDamaged = true;
|
||||||
damage_region += damage;
|
damage_region += damage;
|
||||||
repaints_region += damage;
|
|
||||||
for (const QRect &r : damage.rects()) {
|
for (const QRect &r : damage.rects()) {
|
||||||
emit damaged(this, r);
|
emit damaged(this, r);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue