diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2009-10-01 11:29:39 (GMT) |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2009-10-01 11:38:13 (GMT) |
commit | 09df1ded0bc52700b19b19edf17f7dff5a16a2d9 (patch) | |
tree | 6a1353c11cdac2e52bad9c084b29e74ad4c87c98 | |
parent | 4b878f098c8b723657d4d8ad3c2ce630788df867 (diff) | |
download | Qt-09df1ded0bc52700b19b19edf17f7dff5a16a2d9.zip Qt-09df1ded0bc52700b19b19edf17f7dff5a16a2d9.tar.gz Qt-09df1ded0bc52700b19b19edf17f7dff5a16a2d9.tar.bz2 |
Worked around S60 3.1 bug in CCoeControl::PositionRelativeToScreen
CCoeControl::PositionRelativeToScreen sometimes freezes the device
in S60 3.1 based devices. Exact cause is unknown, but it might be
OOM situation given that some cases where this is an issue, changing
to a simpler theme makes the freeze go away.
Task-number: QTBUG-4565
Reviewed-by: Sami Merila
Reviewed-by: Espen Riskedal
-rw-r--r-- | src/gui/styles/qs60style_s60.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp index 131d8bc..cde48d8 100644 --- a/src/gui/styles/qs60style_s60.cpp +++ b/src/gui/styles/qs60style_s60.cpp @@ -635,8 +635,18 @@ bool QS60StylePrivate::isToolBarBackground() QPoint qt_s60_fill_background_offset(const QWidget *targetWidget) { CCoeControl *control = targetWidget->effectiveWinId(); - TPoint globalPos = control ? control->PositionRelativeToScreen() : TPoint(0,0); - return QPoint(globalPos.iX, globalPos.iY); + TPoint pos(0,0); + if (control) { + // FIXME properly: S60 3.1 has a bug that CCoeControl::PositionRelativeToScreen sometimes + // freezes the device, possibly in cases where we run out of memory. + // We use CCoeControl::Position instead in S60 3.1, which returns same values + // in most cases. + if (QSysInfo::s60Version() == QSysInfo::SV_S60_3_1) + pos = control->Position(); + else + pos = control->PositionRelativeToScreen(); + } + return QPoint(pos.iX, pos.iY); } QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsLX( @@ -1137,11 +1147,11 @@ QPixmap QS60StylePrivate::part(QS60StyleEnums::SkinParts part, const QSize &size, SkinElementFlags flags) { QSymbianFbsHeapLock lock(QSymbianFbsHeapLock::Unlock); - + QPixmap result = (flags & SF_ColorSkinned)? QS60StyleModeSpecifics::colorSkinnedGraphics(part, size, flags) : QS60StyleModeSpecifics::skinnedGraphics(part, size, flags); - + lock.relock(); if (flags & SF_StateDisabled && !QS60StyleModeSpecifics::disabledPartGraphic(part)) { |