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>
This commit is contained in:
Andy Shaw 2018-10-02 15:05:32 +02:00
parent 091a386eaf
commit dc5f9d0c31

View File

@ -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()