diff options
-rw-r--r-- | src/client/qwaylandshmbackingstore.cpp | 10 | ||||
-rw-r--r-- | src/client/qwaylandshmbackingstore_p.h | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/client/qwaylandshmbackingstore.cpp b/src/client/qwaylandshmbackingstore.cpp index 0afdda4c0..045748a16 100644 --- a/src/client/qwaylandshmbackingstore.cpp +++ b/src/client/qwaylandshmbackingstore.cpp @@ -171,12 +171,20 @@ QPaintDevice *QWaylandShmBackingStore::paintDevice() return contentSurface(); } -void QWaylandShmBackingStore::beginPaint(const QRegion &) +void QWaylandShmBackingStore::beginPaint(const QRegion ®ion) { mPainting = true; ensureSize(); waylandWindow()->setCanResize(false); + + if (mBackBuffer->image()->hasAlphaChannel()) { + QPainter p(paintDevice()); + p.setCompositionMode(QPainter::CompositionMode_Source); + const QColor blank = Qt::transparent; + for (const QRect &rect : region) + p.fillRect(rect, blank); + } } void QWaylandShmBackingStore::endPaint() diff --git a/src/client/qwaylandshmbackingstore_p.h b/src/client/qwaylandshmbackingstore_p.h index 8564cc9d2..251368efd 100644 --- a/src/client/qwaylandshmbackingstore_p.h +++ b/src/client/qwaylandshmbackingstore_p.h @@ -94,7 +94,7 @@ public: void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; void resize(const QSize &size, const QRegion &staticContents) override; void resize(const QSize &size); - void beginPaint(const QRegion &) override; + void beginPaint(const QRegion ®ion) override; void endPaint() override; QWaylandAbstractDecoration *windowDecoration() const; |