summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbbackingstore.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-11-02 11:48:55 +0100
committerLiang Qi <liang.qi@qt.io>2018-11-11 22:09:05 +0000
commit508b9b49b9d178db959d2e2066b8d4b9f5173573 (patch)
treed35dcb6c36b429307a6fa1f7f3dbbc5f9cc1db64 /src/plugins/platforms/xcb/qxcbbackingstore.cpp
parentc7275f6723089b0ba5f305fe8f3b51cb6f1eb845 (diff)
Fix image grab when XCB is rgb-swapping
The rgbSwap produces an image that fits the X-server, but not one that fits our internal image definitions, so instead return our internal image. Task-number: QTBUG-56806 Change-Id: I25aedf7279bcd86792213b11dbd07a77b49538de Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbbackingstore.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbbackingstore.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
index c8c806749f..ba9a3e68ee 100644
--- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp
+++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
@@ -837,6 +837,9 @@ void QXcbBackingStore::endPaint()
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();
}