summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2019-03-14 09:37:41 +0100
committerJohan Helsing <johan.helsing@qt.io>2019-03-14 13:30:54 +0000
commit3200e86cefd9a83cea45c7cab589bfbf1ff63f4f (patch)
treec89e87425618ed6b20289c0e8ec45628e4b8f4ff
parent489fedaa320a4941a9fc6a17df1a791c93270bb8 (diff)
Client: Fix incorrect damage region for window decorations
The previous implementation had gaps in several places. [ChangeLog][QPA plugin] Fixed a bug where the window decoration's damaged area didn't cover the entire decoration. This meant some compositors would not redraw those areas. Change-Id: Ic72663dde301936635b2a1cfa90570a53227e8ea Fixes: QTBUG-74341 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
-rw-r--r--src/client/qwaylandabstractdecoration.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/client/qwaylandabstractdecoration.cpp b/src/client/qwaylandabstractdecoration.cpp
index 6a8f1d92..98a0b17d 100644
--- a/src/client/qwaylandabstractdecoration.cpp
+++ b/src/client/qwaylandabstractdecoration.cpp
@@ -100,14 +100,19 @@ void QWaylandAbstractDecoration::setWaylandWindow(QWaylandWindow *window)
d->m_wayland_window = window;
}
-// \a size is without margins
+// Creates regions like this on the outside of a rectangle with inner size \a size
+// -----
+// | |
+// -----
+// I.e. the top and bottom extends into the corners
static QRegion marginsRegion(const QSize &size, const QMargins &margins)
{
QRegion r;
- r += QRect(0, 0, size.width(), margins.top()); // top
- r += QRect(0, size.height()+margins.top(), size.width(), margins.bottom()); //bottom
- r += QRect(0, 0, margins.left(), size.height()); //left
- r += QRect(size.width()+margins.left(), 0, margins.right(), size.height()); // right
+ 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, margins.top(), margins.left(), size.height()); //left
+ r += QRect(size.width()+margins.left(), margins.top(), margins.right(), size.height()); // right
return r;
}