From 709a932d7be8a7ef4c86dbdf93da6b6b08a5ffe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 16 Nov 2021 15:52:22 +0100 Subject: 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 --- src/plugins/platforms/xcb/qxcbbackingstore.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/plugins/platforms/xcb') 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; -- cgit v1.2.3