qt5-qtwayland/SOURCES/0004-Get-correct-decoration...

40 lines
1.7 KiB
Diff
Raw Normal View History

2022-11-08 06:42:10 +00:00
From 50a9256db8cd43665cf74cf94a293d1c05375d33 Mon Sep 17 00:00:00 2001
2021-11-09 10:03:24 +00:00
From: Jan Grulich <jgrulich@redhat.com>
Date: Thu, 11 Feb 2021 15:12:32 +0100
2022-11-08 06:42:10 +00:00
Subject: [PATCH 04/40] Get correct decoration margins region
2021-11-09 10:03:24 +00:00
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.
2022-05-10 07:10:50 +00:00
Pick-to: 5.15 6.0 6.1
2021-11-09 10:03:24 +00:00
Change-Id: Id1b7f4cd2a7b894b82db09c5af2b2d1f1f43fa2a
2022-05-10 07:10:50 +00:00
Reviewed-by: David Edmundson <davidedmundson@kde.org>
2021-11-09 10:03:24 +00:00
---
2022-05-10 07:10:50 +00:00
src/client/qwaylandabstractdecoration.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
2021-11-09 10:03:24 +00:00
diff --git a/src/client/qwaylandabstractdecoration.cpp b/src/client/qwaylandabstractdecoration.cpp
2022-05-10 07:10:50 +00:00
index 87dd6cea..b6ee43c9 100644
2021-11-09 10:03:24 +00:00
--- a/src/client/qwaylandabstractdecoration.cpp
+++ b/src/client/qwaylandabstractdecoration.cpp
2022-05-10 07:10:50 +00:00
@@ -108,11 +108,11 @@ void QWaylandAbstractDecoration::setWaylandWindow(QWaylandWindow *window)
2021-11-09 10:03:24 +00:00
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;
}
2022-05-10 07:10:50 +00:00
--
2022-11-08 06:42:10 +00:00
2.35.1
2022-05-10 07:10:50 +00:00