xcb: Don't mark scrolled area as flushed when doing client side scroll

The m_pendingFlush variable is used to track what is missing in the
server side backingstore. If we're doing a client side scroll the
pending area is still the same.

If we were to always discard the scrolled area from m_pendingFlush
we would get in trouble on the next non-client side scroll, as
we think the content exists server-side.

Change-Id: Ie50a99a8e5d8a83d1299c53534a1c83c6bfb47bd
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 71f75bf6c5140920227f6019716c05fe7bfb0b20)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Tor Arne Vestbø 2021-11-16 21:34:56 +01:00 committed by Qt Cherry-pick Bot
parent 6948ef6ca7
commit 09af4d9e8e

View File

@ -493,10 +493,13 @@ bool QXcbBackingStoreImage::scroll(const QRegion &area, int dx, int dy)
} else {
ensureGC(m_xcb_pixmap);
if (hasShm())
shmPutImage(m_xcb_pixmap, m_pendingFlush.intersected(scrollArea));
else
if (hasShm()) {
QRegion partialFlushRegion = m_pendingFlush.intersected(scrollArea);
shmPutImage(m_xcb_pixmap, partialFlushRegion);
m_pendingFlush -= partialFlushRegion;
} else {
flushPixmap(scrollArea);
}
for (const QRect &src : scrollArea) {
const QRect dst = src.translated(delta).intersected(bounds);
@ -508,15 +511,13 @@ bool QXcbBackingStoreImage::scroll(const QRegion &area, int dx, int dy)
dst.x(), dst.y(),
dst.width(), dst.height());
}
if (hasShm())
m_pendingFlush -= destinationRegion;
}
m_scrolledRegion |= destinationRegion;
if (hasShm()) {
m_pendingFlush -= scrollArea;
m_pendingFlush -= m_scrolledRegion;
}
return true;
}