From 719990d4ef4729ba5e145306f555bcd73ea944e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 1 Oct 2021 13:54:47 +0200 Subject: xcb: Flush scrolled region of backingstore to client when requesting image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ł Reviewed-by: Laszlo Agocs --- src/plugins/platforms/xcb/qxcbbackingstore.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms') 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 -- cgit v1.2.3