Blame SOURCES/0016-Get-correct-decoration-margins-region.patch

de89c0
From 6810b0f66a34056bfe0da7299d7a768e700e58f5 Mon Sep 17 00:00:00 2001
c54cd9
From: Jan Grulich <jgrulich@redhat.com>
c54cd9
Date: Thu, 11 Feb 2021 15:12:32 +0100
de89c0
Subject: [PATCH 16/36] Get correct decoration margins region
c54cd9
c54cd9
Size we use to calculate margins region already contains size including
c54cd9
margins. This resulted into bigger region and not properly damaging
c54cd9
region we need to update.
c54cd9
de89c0
Pick-to: 5.15 6.0 6.1
c54cd9
Change-Id: Id1b7f4cd2a7b894b82db09c5af2b2d1f1f43fa2a
de89c0
Reviewed-by: David Edmundson <davidedmundson@kde.org>
c54cd9
---
de89c0
 src/client/qwaylandabstractdecoration.cpp | 8 ++++----
de89c0
 1 file changed, 4 insertions(+), 4 deletions(-)
c54cd9
c54cd9
diff --git a/src/client/qwaylandabstractdecoration.cpp b/src/client/qwaylandabstractdecoration.cpp
de89c0
index 87dd6cea..b6ee43c9 100644
c54cd9
--- a/src/client/qwaylandabstractdecoration.cpp
c54cd9
+++ b/src/client/qwaylandabstractdecoration.cpp
de89c0
@@ -108,11 +108,11 @@ void QWaylandAbstractDecoration::setWaylandWindow(QWaylandWindow *window)
c54cd9
 static QRegion marginsRegion(const QSize &size, const QMargins &margins)
c54cd9
 {
c54cd9
     QRegion r;
c54cd9
-    const int widthWithMargins = margins.left() + size.width() + margins.right();
c54cd9
-    r += QRect(0, 0, widthWithMargins, margins.top()); // top
c54cd9
-    r += QRect(0, size.height()+margins.top(), widthWithMargins, margins.bottom()); //bottom
c54cd9
+
c54cd9
+    r += QRect(0, 0, size.width(), margins.top()); // top
c54cd9
+    r += QRect(0, size.height()-margins.bottom(), size.width(), margins.bottom()); //bottom
c54cd9
     r += QRect(0, margins.top(), margins.left(), size.height()); //left
c54cd9
-    r += QRect(size.width()+margins.left(), margins.top(), margins.right(), size.height()); // right
c54cd9
+    r += QRect(size.width()-margins.left(), margins.top(), margins.right(), size.height()-margins.top()); // right
c54cd9
     return r;
c54cd9
 }
c54cd9
 
de89c0
-- 
de89c0
2.33.1
de89c0