From 34951b3bee88fd099768c8fe390a5e74371f8135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 4 Mar 2016 16:33:09 +0100 Subject: [PATCH] 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. --- client.cpp | 1 + shell_client.cpp | 1 + toplevel.cpp | 1 - 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/client.cpp b/client.cpp index cb8dbf16e6..5c49b1691d 100644 --- a/client.cpp +++ b/client.cpp @@ -2125,6 +2125,7 @@ void Client::addDamage(const QRegion &damage) setupWindowManagementInterface(); } } + repaints_region += damage; Toplevel::addDamage(damage); } diff --git a/shell_client.cpp b/shell_client.cpp index 7170007ea1..1986a4a4f6 100644 --- a/shell_client.cpp +++ b/shell_client.cpp @@ -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); } diff --git a/toplevel.cpp b/toplevel.cpp index 12d3177964..af368b5fb8 100644 --- a/toplevel.cpp +++ b/toplevel.cpp @@ -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); }