From dc5f9d0c3101f95185d3c562d001e0af18f46a0b Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Tue, 2 Oct 2018 15:05:32 +0200 Subject: [PATCH] Only use a translucent background if there is support for alpha Change-Id: Ia8d9e543fac4b6e790fa38cf04c5a782d72d72df Reviewed-by: Eirik Aavitsland Reviewed-by: Gatis Paeglis --- .../platforms/xcb/nativepainting/qbackingstore_x11.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp b/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp index 8851ea59e50..ed482e5daee 100644 --- a/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp +++ b/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp @@ -62,8 +62,10 @@ QXcbNativeBackingStore::QXcbNativeBackingStore(QWindow *window) : QPlatformBackingStore(window) , m_translucentBackground(false) { - if (QXcbWindow *w = static_cast(window->handle())) - m_translucentBackground = w->connection()->hasXRender() && QImage::toPixelFormat(w->imageFormat()).alphaSize() > 0; + if (QXcbWindow *w = static_cast(window->handle())) { + m_translucentBackground = w->connection()->hasXRender() && + QImage::toPixelFormat(w->imageFormat()).alphaUsage() == QPixelFormat::UsesAlpha; + } } QXcbNativeBackingStore::~QXcbNativeBackingStore()