summaryrefslogtreecommitdiffstats
path: root/src/gui/styles
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-09-23 12:04:10 (GMT)
committerGunnar Sletta <gunnar@trolltech.com>2009-09-23 12:07:43 (GMT)
commite5ecc1970e6d83fa69461a2bff22f43e5116f5f5 (patch)
treea7a10e055b44a76bfc860c351ef5d106514d3a3f /src/gui/styles
parent154f2ba23c87a0d316e3a9c263efa7dd3bbef6ce (diff)
downloadQt-e5ecc1970e6d83fa69461a2bff22f43e5116f5f5.zip
Qt-e5ecc1970e6d83fa69461a2bff22f43e5116f5f5.tar.gz
Qt-e5ecc1970e6d83fa69461a2bff22f43e5116f5f5.tar.bz2
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
Diffstat (limited to 'src/gui/styles')
-rw-r--r--src/gui/styles/qwindowsxpstyle.cpp11
1 files changed, 10 insertions, 1 deletions
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