Blame SOURCES/qtwayland-get-correct-margins-decoration-region.patch

89d4c9
From 14cf9f0e45c7617d787eba8d81bf9fd1cd66754b Mon Sep 17 00:00:00 2001
89d4c9
From: Jan Grulich <jgrulich@redhat.com>
89d4c9
Date: Thu, 11 Feb 2021 15:12:32 +0100
89d4c9
Subject: [PATCH] Get correct decoration margins region
89d4c9
89d4c9
Size we use to calculate margins region already contains size including
89d4c9
margins. This resulted into bigger region and not properly damaging
89d4c9
region we need to update.
89d4c9
89d4c9
Pick-to: 5.15
89d4c9
Change-Id: Id1b7f4cd2a7b894b82db09c5af2b2d1f1f43fa2a
89d4c9
---
89d4c9
89d4c9
diff --git a/src/client/qwaylandabstractdecoration.cpp b/src/client/qwaylandabstractdecoration.cpp
89d4c9
index 87dd6ce..b6ee43c 100644
89d4c9
--- a/src/client/qwaylandabstractdecoration.cpp
89d4c9
+++ b/src/client/qwaylandabstractdecoration.cpp
89d4c9
@@ -108,11 +108,11 @@
89d4c9
 static QRegion marginsRegion(const QSize &size, const QMargins &margins)
89d4c9
 {
89d4c9
     QRegion r;
89d4c9
-    const int widthWithMargins = margins.left() + size.width() + margins.right();
89d4c9
-    r += QRect(0, 0, widthWithMargins, margins.top()); // top
89d4c9
-    r += QRect(0, size.height()+margins.top(), widthWithMargins, margins.bottom()); //bottom
89d4c9
+
89d4c9
+    r += QRect(0, 0, size.width(), margins.top()); // top
89d4c9
+    r += QRect(0, size.height()-margins.bottom(), size.width(), margins.bottom()); //bottom
89d4c9
     r += QRect(0, margins.top(), margins.left(), size.height()); //left
89d4c9
-    r += QRect(size.width()+margins.left(), margins.top(), margins.right(), size.height()); // right
89d4c9
+    r += QRect(size.width()-margins.left(), margins.top(), margins.right(), size.height()-margins.top()); // right
89d4c9
     return r;
89d4c9
 }
89d4c9