summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-11-16 15:52:22 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-11-18 23:41:02 +0100
commit709a932d7be8a7ef4c86dbdf93da6b6b08a5ffe0 (patch)
treedc090dcc9bff48f448725f2ab70c6e855cc15527 /src/plugins
parent7102aa6b1596a07365c75cf373dde06ea8e71231 (diff)
xcb: Prepare correct area when doing client side backingstore scroll
The area we're going to fill is the one after applying the scroll delta. Pick-to: 6.2 Change-Id: I254830a15e5f4c93ba28ed8f0a9b35c40f1d1af2 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/xcb/qxcbbackingstore.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
index 4ef2d53343..6fec282f29 100644
--- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp
+++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
@@ -479,13 +479,14 @@ bool QXcbBackingStoreImage::scroll(const QRegion &area, int dx, int dy)
const QRect bounds(QPoint(), size());
const QRegion scrollArea(area & bounds);
const QPoint delta(dx, dy);
+ const QRegion destinationRegion = scrollArea.translated(delta).intersected(bounds);
if (m_clientSideScroll) {
if (m_qimage.isNull())
return false;
if (hasShm())
- preparePaint(scrollArea);
+ preparePaint(destinationRegion);
for (const QRect &rect : scrollArea)
qt_scrollRectInImage(m_qimage, rect, delta);
@@ -509,7 +510,8 @@ bool QXcbBackingStoreImage::scroll(const QRegion &area, int dx, int dy)
}
}
- m_scrolledRegion |= scrollArea.translated(delta).intersected(bounds);
+ m_scrolledRegion |= destinationRegion;
+
if (hasShm()) {
m_pendingFlush -= scrollArea;
m_pendingFlush -= m_scrolledRegion;