From 6948ef6ca7738414c96feb4f18976c9ff144b05a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 16 Nov 2021 17:32:37 +0100 Subject: [PATCH] xcb: Ensure we have pixmap GC before trying to flush to it during scroll Change-Id: Icc85b1eb830d8d9b1b2bfb8b9998470388522832 Reviewed-by: Laszlo Agocs (cherry picked from commit 12af9ce6dbf4e523265c32edac7cd6c8ee006783) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/platforms/xcb/qxcbbackingstore.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp index 6fec282f29d..b4993bfd179 100644 --- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp +++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp @@ -491,13 +491,13 @@ bool QXcbBackingStoreImage::scroll(const QRegion &area, int dx, int dy) for (const QRect &rect : scrollArea) qt_scrollRectInImage(m_qimage, rect, delta); } else { + ensureGC(m_xcb_pixmap); + if (hasShm()) shmPutImage(m_xcb_pixmap, m_pendingFlush.intersected(scrollArea)); else flushPixmap(scrollArea); - ensureGC(m_xcb_pixmap); - for (const QRect &src : scrollArea) { const QRect dst = src.translated(delta).intersected(bounds); xcb_copy_area(xcb_connection(),