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>
bb10
Allan Sandfeld Jensen 2018-11-02 11:48:55 +01:00 committed by Liang Qi
parent c7275f6723
commit 508b9b49b9
1 changed files with 3 additions and 0 deletions

View File

@ -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();
}