From 4e2e9ab78adf498405109603ce7d9f20d5f12abc Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Mon, 19 Dec 2022 18:15:00 +0000 Subject: [PATCH] wayland: Fix updating pixel data from translucent client buffers when using qpainter backend We must set QPainter::CompositionMode_Source to overwrite the old contents. --- .../scenes/qpainter/qpaintersurfacetexture_wayland.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/platformsupport/scenes/qpainter/qpaintersurfacetexture_wayland.cpp b/src/platformsupport/scenes/qpainter/qpaintersurfacetexture_wayland.cpp index a65f09da83..fd395353e8 100644 --- a/src/platformsupport/scenes/qpainter/qpaintersurfacetexture_wayland.cpp +++ b/src/platformsupport/scenes/qpainter/qpaintersurfacetexture_wayland.cpp @@ -43,6 +43,7 @@ void QPainterSurfaceTextureWayland::update(const QRegion ®ion) const QImage image = buffer->data(); const QRegion dirtyRegion = mapRegion(m_pixmap->item()->surfaceToBufferMatrix(), region); QPainter painter(&m_image); + painter.setCompositionMode(QPainter::CompositionMode_Source); // The buffer data is copied as the buffer interface returns a QImage // which doesn't own the data of the underlying wl_shm_buffer object.