Skip to content

Commit

Permalink
Only use a translucent background if there is support for alpha
Browse files Browse the repository at this point in the history
Change-Id: Ia8d9e543fac4b6e790fa38cf04c5a782d72d72df
Reviewed-by: Eirik Aavitsland <[email protected]>
Reviewed-by: Gatis Paeglis <[email protected]>
  • Loading branch information
AndyShawQt committed Oct 12, 2018
1 parent 091a386 commit dc5f9d0
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit dc5f9d0

Please sign in to comment.