From 0047fd3703fcec3afbbaff13e7a2d96d60f3f8f4 Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Thu, 14 Jan 2010 14:20:24 +0100 Subject: Enable surface transparency support on Symbian^4. On Symbian^4 systems where the window supports surface transparency, we use this for the Qt::WA_TranslucentBackground flag instead of the previous method. Task-number: QT-2026 Reviewed-by: Iain --- src/corelib/global/qglobal.h | 4 ++++ src/gui/kernel/qwidget_s60.cpp | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 52e9845..f350d1a 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -2419,6 +2419,10 @@ QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf(); //enabling new graphics resources #define QT_SYMBIAN_SUPPORTS_SGIMAGE #define QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER + +#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS +#define Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE +#endif #endif diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 4c0e21e..00f2213 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -389,9 +389,13 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de if (!isOpaque) { RWindow *const window = static_cast(drawableWindow); +#ifdef Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE + window->SetSurfaceTransparency(true); +#else const TDisplayMode displayMode = static_cast(window->SetRequiredDisplayMode(EColor16MA)); if (window->SetTransparencyAlphaChannel() == KErrNone) window->SetBackgroundColor(TRgb(255, 255, 255, 0)); +#endif } } @@ -707,12 +711,16 @@ void QWidgetPrivate::s60UpdateIsOpaque() RWindow *const window = static_cast(q->effectiveWinId()->DrawableWindow()); +#ifdef Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE + window->SetSurfaceTransparency(!isOpaque); +#else if (!isOpaque) { const TDisplayMode displayMode = static_cast(window->SetRequiredDisplayMode(EColor16MA)); if (window->SetTransparencyAlphaChannel() == KErrNone) window->SetBackgroundColor(TRgb(255, 255, 255, 0)); } else window->SetTransparentRegion(TRegionFix<1>()); +#endif } void QWidgetPrivate::setWindowIcon_sys(bool forceReset) -- cgit v0.12