From 8163f070aee2b3d40e588009c837d81a145fcfd1 Mon Sep 17 00:00:00 2001 From: Jacopo De Simoi Date: Thu, 31 Mar 2011 12:17:59 +0200 Subject: Fix window pixmap initialization strategy If a compositing manager is active, setting the window pixmap background to None for ARGB windows makes little sense. In this case the background should be transparent Merge-request: 1135 Reviewed-by: Denis Dzyubenko --- src/gui/kernel/qwidget_x11.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp index 4f39443..5ece7d6 100644 --- a/src/gui/kernel/qwidget_x11.cpp +++ b/src/gui/kernel/qwidget_x11.cpp @@ -1380,9 +1380,15 @@ void QWidgetPrivate::updateSystemBackground() if (brush.style() == Qt::NoBrush || q->testAttribute(Qt::WA_NoSystemBackground) || q->testAttribute(Qt::WA_UpdatesDisabled) - || type == Qt::Popup || type == Qt::ToolTip - ) - XSetWindowBackgroundPixmap(X11->display, q->internalWinId(), XNone); + || type == Qt::Popup || type == Qt::ToolTip) { + if (QX11Info::isCompositingManagerRunning() + && q->testAttribute(Qt::WA_TranslucentBackground) + && !(q->parent())) + XSetWindowBackground(X11->display, q->internalWinId(), + QColormap::instance(xinfo.screen()).pixel(Qt::transparent)); + else + XSetWindowBackgroundPixmap(X11->display, q->internalWinId(), XNone); + } else if (brush.style() == Qt::SolidPattern && brush.isOpaque()) XSetWindowBackground(X11->display, q->internalWinId(), QColormap::instance(xinfo.screen()).pixel(brush.color())); -- cgit v0.12