From 732ea4facab9c877a87dfa671de3cd034afb293d Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Sun, 9 Mar 2025 09:59:47 +0100 Subject: [PATCH] QWaylandShmBackingStore: Clear in beginPaint based on surface format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's the surface format that matters not the backing image format. Now that QWaylandShmWindow sets a proper QSurfaceFormat, we can actually check it. Change-Id: Ia17a9f06cd335b6e8f6989051bc9d0cef9bfe3f3 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp b/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp index a993817654c..9ca2415a320 100644 --- a/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp +++ b/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp @@ -196,7 +196,7 @@ void QWaylandShmBackingStore::beginPaint(const QRegion ®ion) // Although undocumented, QBackingStore::beginPaint expects the painted region // to be cleared before use if the window has a surface format with an alpha. // Fresh QWaylandShmBuffer are already cleared, so we don't need to clear those. - if (!bufferWasRecreated && mBackBuffer->image()->hasAlphaChannel()) { + if (!bufferWasRecreated && window()->format().hasAlpha()) { QPainter p(paintDevice()); p.setCompositionMode(QPainter::CompositionMode_Source); const QColor blank = Qt::transparent;