diff options
author | Jani Hautakangas <jani.hautakangas@nokia.com> | 2010-11-17 12:59:15 (GMT) |
---|---|---|
committer | Jani Hautakangas <jani.hautakangas@nokia.com> | 2010-11-17 16:28:41 (GMT) |
commit | 14ddf44ce2fdd7195741b9683226a3cd774e17e4 (patch) | |
tree | 320b1d0a8b09067cfc3289552476ccfbc4308e25 /src/gui/kernel/qwidget_s60.cpp | |
parent | 515fd562d87290c3fc0eb45817434dd0744d346e (diff) | |
download | Qt-14ddf44ce2fdd7195741b9683226a3cd774e17e4.zip Qt-14ddf44ce2fdd7195741b9683226a3cd774e17e4.tar.gz Qt-14ddf44ce2fdd7195741b9683226a3cd774e17e4.tar.bz2 |
Fix for WServ 64 crash on Symbian.
Crash happens if application first sets WA_OpaquePaintEvent flag
and then sets WA_TranslucentBackground flag. In that case
WA_TranslucentBackground flag is ineffective leading to situation
where Qt Symbian adaptation tries to reset native window transparency
but because native window is already opaque due to WA_OpaquePaintEvent,
WServ 64 crash occurs.
Task-number: QTBUG-15369
Reviewed-by: Jason Barron
Diffstat (limited to 'src/gui/kernel/qwidget_s60.cpp')
-rw-r--r-- | src/gui/kernel/qwidget_s60.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index cf4bdf1..6ce46d3 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -767,17 +767,24 @@ void QWidgetPrivate::s60UpdateIsOpaque() if (!q->testAttribute(Qt::WA_WState_Created) || !q->testAttribute(Qt::WA_TranslucentBackground)) return; + createTLExtra(); + RWindow *const window = static_cast<RWindow *>(q->effectiveWinId()->DrawableWindow()); #ifdef Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE window->SetSurfaceTransparency(!isOpaque); + extra->topextra->nativeWindowTransparencyEnabled = !isOpaque; #else if (!isOpaque) { const TDisplayMode displayMode = static_cast<TDisplayMode>(window->SetRequiredDisplayMode(EColor16MA)); - if (window->SetTransparencyAlphaChannel() == KErrNone) + if (window->SetTransparencyAlphaChannel() == KErrNone) { window->SetBackgroundColor(TRgb(255, 255, 255, 0)); - } else + extra->topextra->nativeWindowTransparencyEnabled = 1; + } + } else if (extra->topextra->nativeWindowTransparencyEnabled) { window->SetTransparentRegion(TRegionFix<1>()); + extra->topextra->nativeWindowTransparencyEnabled = 0; + } #endif } @@ -936,6 +943,7 @@ void QWidgetPrivate::registerDropSite(bool /* on */) void QWidgetPrivate::createTLSysExtra() { extra->topextra->inExpose = 0; + extra->topextra->nativeWindowTransparencyEnabled = 0; } void QWidgetPrivate::deleteTLSysExtra() |