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>
This commit is contained in:
Tor Arne Vestbø 2021-11-16 15:52:22 +01:00
parent 7102aa6b15
commit 709a932d7b

View File

@ -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;