summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-10-01 13:54:47 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-10-05 18:29:11 +0200
commit719990d4ef4729ba5e145306f555bcd73ea944e7 (patch)
tree817a8aa30faab8c0f4157696a569487250074d7e /src/plugins/platforms/xcb
parent0a02d845559e4fd9d1bd72942c5118f3bb1307bf (diff)
xcb: Flush scrolled region of backingstore to client when requesting image
We were doing this for composeAndFlush already, which accesses the image via graphicsBuffer(). Task-number: QTBUG-64504 Task-number: QTBUG-64414 Pick-to: 6.2 Change-Id: I51cc002db8a15991f8a8aa32e849c07318e6e74c Reviewed-by: Błażej Szczygieł <mumei6102@gmail.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r--src/plugins/platforms/xcb/qxcbbackingstore.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
index bfcd1b2320..4ef2d53343 100644
--- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp
+++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
@@ -842,7 +842,12 @@ QImage QXcbBackingStore::toImage() const
// If the backingstore is rgbSwapped, return the internal image type here.
if (!m_rgbImage.isNull())
return m_rgbImage;
- return m_image && m_image->image() ? *m_image->image() : QImage();
+
+ if (!m_image || !m_image->image())
+ return QImage();
+
+ m_image->flushScrolledRegion(true);
+ return *m_image->image();
}
QPlatformGraphicsBuffer *QXcbBackingStore::graphicsBuffer() const