diff options
author | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2009-11-03 13:42:29 (GMT) |
---|---|---|
committer | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2009-11-03 13:42:29 (GMT) |
commit | 63f2cc8d9526d3fd8a64e62be2a469bf0eee54f0 (patch) | |
tree | 7e6724964ceb6e38f478074780f06df0bdd11dbd /src/gui/kernel/qapplication_s60.cpp | |
parent | 6a89291da7e1322ad81c4939cc9d69db01957a4c (diff) | |
parent | dc89c842779f87ce69882ba54fa8d5bb79e0edbd (diff) | |
download | Qt-63f2cc8d9526d3fd8a64e62be2a469bf0eee54f0.zip Qt-63f2cc8d9526d3fd8a64e62be2a469bf0eee54f0.tar.gz Qt-63f2cc8d9526d3fd8a64e62be2a469bf0eee54f0.tar.bz2 |
Merge branch '4.6' into mmfphonon
Diffstat (limited to 'src/gui/kernel/qapplication_s60.cpp')
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index e2106ea..2b24011 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -839,7 +839,7 @@ void QSymbianControl::Draw(const TRect& controlRect) const if (qwidget->d_func()->isOpaque) gc.SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha); gc.BitBlt(controlRect.iTl, bitmap, backingStoreRect); - } + } } else { surface->flush(qwidget, QRegion(qt_TRect2QRect(backingStoreRect)), QPoint()); } @@ -913,9 +913,9 @@ void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */) CEikStatusPane* statusPane = S60->statusPane(); CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer(); bool isFullscreen = qwidget->windowState() & Qt::WindowFullScreen; - if (statusPane && (statusPane->IsVisible() == isFullscreen)) + if (statusPane && (bool)statusPane->IsVisible() == isFullscreen) statusPane->MakeVisible(!isFullscreen); - if (buttonGroup && (buttonGroup->IsVisible() == isFullscreen)) + if (buttonGroup && (bool)buttonGroup->IsVisible() == isFullscreen) buttonGroup->MakeVisible(!isFullscreen); #endif } else if (QApplication::activeWindow() == qwidget->window()) { @@ -928,6 +928,12 @@ void QSymbianControl::HandleResourceChange(int resourceType) { switch (resourceType) { case KInternalStatusPaneChange: + if (qwidget->isFullScreen()) { + SetExtentToWholeScreen(); + } else if (qwidget->isMaximized()) { + TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect(); + SetExtent(r.iTl, r.Size()); + } qwidget->d_func()->setWindowIcon_sys(true); break; case KUidValueCoeFontChangeEvent: @@ -1033,6 +1039,14 @@ QApplication::QApplication(QApplication::QS60MainApplicationFactory factory, int void qt_init(QApplicationPrivate * /* priv */, int) { if (!CCoeEnv::Static()) { + // The S60 framework creates a new trap handler which will render any existing traps + // invalid as long as it is active. This means that all code in main() that occurs after + // the QApplication construction needs to be surrounded by a new trap, despite having + // an outer one already. To avoid this, we save the original trap handler here, and set + // it back after the S60 framework is constructed. Then we restore it right before the S60 + // framework destruction. + TTrapHandler *origTrapHandler = User::TrapHandler(); + // The S60 framework has not been initalized. We need to do it. TApaApplicationFactory factory(S60->s60ApplicationFactory ? S60->s60ApplicationFactory : newS60Application); @@ -1044,6 +1058,8 @@ void qt_init(QApplicationPrivate * /* priv */, int) QT_TRAP_THROWING(coe->ConstructAppFromCommandLineL(factory,*commandLine)); delete commandLine; + S60->s60InstalledTrapHandler = User::SetTrapHandler(origTrapHandler); + S60->qtOwnsS60Environment = true; } else { S60->qtOwnsS60Environment = false; @@ -1073,9 +1089,9 @@ void qt_init(QApplicationPrivate * /* priv */, int) // enable focus events - used to re-enable mouse after focus changed between mouse and non mouse app, // and for dimming behind modal windows - S60->windowGroup().EnableFocusChangeEvents(); + S60->windowGroup().EnableFocusChangeEvents(); - //Check if mouse interaction is supported (either EMouse=1 in the HAL, or EMachineUID is one of the phones known to support this) + //Check if mouse interaction is supported (either EMouse=1 in the HAL, or EMachineUID is one of the phones known to support this) const TInt KMachineUidSamsungI8510 = 0x2000C51E; // HAL::Get(HALData::EPen, TInt& result) may set 'result' to 1 on some 3.1 systems (e.g. N95). // But we know that S60 systems below 5.0 did not support touch. @@ -1198,6 +1214,9 @@ void qt_cleanup() S60->wsSession().SetPointerCursorMode(EPointerCursorNone); if (S60->qtOwnsS60Environment) { + // Restore the S60 framework trap handler. See qt_init(). + User::SetTrapHandler(S60->s60InstalledTrapHandler); + CEikonEnv* coe = CEikonEnv::Static(); coe->PrepareToExit(); // The CEikonEnv itself is destroyed in here. @@ -1550,7 +1569,7 @@ int QApplicationPrivate::symbianProcessWsEvent(const TWsEvent *event) } #endif break; - default: + default: break; } |