summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbbackingstore.cpp
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-11-16 21:34:56 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-11-18 23:41:02 +0100
commit71f75bf6c5140920227f6019716c05fe7bfb0b20 (patch)
tree0f5de0a614bf4fa2278ac33b9a7b77c1968f93ef /src/plugins/platforms/xcb/qxcbbackingstore.cpp
parent12af9ce6dbf4e523265c32edac7cd6c8ee006783 (diff)
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. Pick-to: 6.2 Change-Id: Ie50a99a8e5d8a83d1299c53534a1c83c6bfb47bd 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.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
index b4993bfd17..796ca24265 100644
--- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp
+++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
@@ -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;
}