From 85777aaac261d0e04aa1da43d59da72fc2336b13 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Sun, 29 Sep 2019 11:44:47 +0300 Subject: [PATCH] [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 --- xdgshellclient.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xdgshellclient.cpp b/xdgshellclient.cpp index a8def39ef1..cc1b65d151 100644 --- a/xdgshellclient.cpp +++ b/xdgshellclient.cpp @@ -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); }