summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Grulich <jgrulich@redhat.com>2021-02-11 15:12:32 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-03-02 09:23:21 +0000
commit5cfd9d01fef2144725e4470d093dc38724e0ace5 (patch)
treee2aa60684b26d7da115b4b9aa959095e751bb520
parent7193e64ef16a72b71d08a48f096ba854631d1b5f (diff)
Get correct decoration margins region
Size we use to calculate margins region already contains size including margins. This resulted into bigger region and not properly damaging region we need to update. Change-Id: Id1b7f4cd2a7b894b82db09c5af2b2d1f1f43fa2a Reviewed-by: David Edmundson <davidedmundson@kde.org> (cherry picked from commit 1631315387faff3b4ae5c5ff1afb95e42f986e4c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/client/qwaylandabstractdecoration.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/qwaylandabstractdecoration.cpp b/src/client/qwaylandabstractdecoration.cpp
index 17b42c0fe..583344273 100644
--- a/src/client/qwaylandabstractdecoration.cpp
+++ b/src/client/qwaylandabstractdecoration.cpp
@@ -108,11 +108,11 @@ void QWaylandAbstractDecoration::setWaylandWindow(QWaylandWindow *window)
static QRegion marginsRegion(const QSize &size, const QMargins &margins)
{
QRegion r;
- const int widthWithMargins = margins.left() + size.width() + margins.right();
- r += QRect(0, 0, widthWithMargins, margins.top()); // top
- r += QRect(0, size.height()+margins.top(), widthWithMargins, margins.bottom()); //bottom
+
+ r += QRect(0, 0, size.width(), margins.top()); // top
+ r += QRect(0, size.height()-margins.bottom(), size.width(), margins.bottom()); //bottom
r += QRect(0, margins.top(), margins.left(), size.height()); //left
- r += QRect(size.width()+margins.left(), margins.top(), margins.right(), size.height()); // right
+ r += QRect(size.width()-margins.left(), margins.top(), margins.right(), size.height()-margins.top()); // right
return r;
}