summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbbackingstore.cpp
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2022-04-04 12:18:47 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2022-04-07 03:18:56 +0200
commit04837c16873e80ff02801a73126121040a6540ec (patch)
tree02ac557a5688407a7b62cf3cfd4eaa129d8d8013 /src/plugins/platforms/xcb/qxcbbackingstore.cpp
parentc1b0b061e14d1b41551dd0035a5c1f2f833f944e (diff)
Don't blit individual rects of region when when scrolling backingstore
The QPlatformBackingStore::scroll() API takes a QRegion as input, but we have no guarantee that the individual source and destination rects of the region will not overlap each other when applying the scroll offset, so we can't naively iterate the rects and call qt_scrollRectInImage for each one. The reason this didn't cause any issues in practice was that the QWidget repaint manager was always passing in a single rect as the region. On the other hand, the client has requested a scroll of the given region, so it might assume any other part of the backing store is preserved as is. Scrolling the bounding rect of the region violates this assumption. Amends 19ef76b0606621f189d3bc56549d200f2f5ebb25. Pick-to: 6.2 6.3 Change-Id: I27934dd6685311c0b53ea2adb60fa5997e360f6c Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbbackingstore.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbbackingstore.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
index 1ea64f9f92..fda97ad2b0 100644
--- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp
+++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
@@ -488,8 +488,8 @@ bool QXcbBackingStoreImage::scroll(const QRegion &area, int dx, int dy)
if (hasShm())
preparePaint(destinationRegion);
- for (const QRect &rect : scrollArea)
- qt_scrollRectInImage(m_qimage, rect, delta);
+ const QRect rect = scrollArea.boundingRect();
+ qt_scrollRectInImage(m_qimage, rect, delta);
} else {
ensureGC(m_xcb_pixmap);