summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2018-10-02 15:05:32 +0200
committerAndy Shaw <andy.shaw@qt.io>2018-10-12 07:26:55 +0000
commitdc5f9d0c3101f95185d3c562d001e0af18f46a0b (patch)
treeeeeeab171cb4e744083ceac1b8960792cf22bb8c
parent091a386eaf91ad8932332a8aefc2df793de59f6c (diff)
Only use a translucent background if there is support for alpha
Change-Id: Ia8d9e543fac4b6e790fa38cf04c5a782d72d72df Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
-rw-r--r--src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp6
1 files 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 8851ea59e5..ed482e5dae 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<QXcbWindow *>(window->handle()))
- m_translucentBackground = w->connection()->hasXRender() && QImage::toPixelFormat(w->imageFormat()).alphaSize() > 0;
+ if (QXcbWindow *w = static_cast<QXcbWindow *>(window->handle())) {
+ m_translucentBackground = w->connection()->hasXRender() &&
+ QImage::toPixelFormat(w->imageFormat()).alphaUsage() == QPixelFormat::UsesAlpha;
+ }
}
QXcbNativeBackingStore::~QXcbNativeBackingStore()