From e5ecc1970e6d83fa69461a2bff22f43e5116f5f5 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Wed, 23 Sep 2009 14:04:10 +0200 Subject: Fall back to pixmaps in xp style when toplevel is translucent The "fast path" will write bad premlutiplied pixels into the backbuffer so the blending will be broken, plus that the window does not get mouse events for alpha=0 pixels. Reviewed-by: Marius Storm-Olsen --- src/gui/styles/qwindowsxpstyle.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/gui/styles/qwindowsxpstyle.cpp b/src/gui/styles/qwindowsxpstyle.cpp index 0dc1832..9c374d8 100644 --- a/src/gui/styles/qwindowsxpstyle.cpp +++ b/src/gui/styles/qwindowsxpstyle.cpp @@ -621,12 +621,21 @@ void QWindowsXPStylePrivate::drawBackground(XPThemeData &themeData) QMatrix m = painter->matrix(); bool complexXForm = m.m11() != 1.0 || m.m22() != 1.0 || m.m12() != 0.0 || m.m21() != 0.0; + bool translucentToplevel = false; + QPaintDevice *pdev = painter->device(); + if (pdev->devType() == QInternal::Widget) { + QWidget *win = ((QWidget *) pdev)->window(); + translucentToplevel = win->testAttribute(Qt::WA_TranslucentBackground); + } + bool useFallback = painter->paintEngine()->getDC() == 0 || painter->opacity() != 1.0 || themeData.rotate || complexXForm || themeData.mirrorVertically - || (themeData.mirrorHorizontally && pDrawThemeBackgroundEx == 0); + || (themeData.mirrorHorizontally && pDrawThemeBackgroundEx == 0) + || translucentToplevel; + if (!useFallback) drawBackgroundDirectly(themeData); else -- cgit v0.12