summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/kernel.pri2
-rw-r--r--src/gui/kernel/qapplication.cpp17
-rw-r--r--src/gui/kernel/qapplication_s60.cpp9
-rw-r--r--src/gui/kernel/qt_s60_p.h55
4 files changed, 80 insertions, 3 deletions
diff --git a/src/gui/kernel/kernel.pri b/src/gui/kernel/kernel.pri
index f9c84c1..467eb9b 100644
--- a/src/gui/kernel/kernel.pri
+++ b/src/gui/kernel/kernel.pri
@@ -111,6 +111,8 @@ win32 {
}
symbian {
+ exists($${EPOCROOT}epoc32/include/platform/mw/akntranseffect.h): DEFINES += QT_SYMBIAN_HAVE_AKNTRANSEFFECT_H
+
SOURCES += \
kernel/qapplication_s60.cpp \
kernel/qeventdispatcher_s60.cpp \
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 59aec91..f906bbf 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -128,6 +128,10 @@ extern bool qt_wince_is_pocket_pc(); //qguifunctions_wince.cpp
//#define ALIEN_DEBUG
+#if defined(Q_OS_SYMBIAN)
+#include "qt_s60_p.h"
+#endif
+
static void initResources()
{
#if defined(Q_WS_WINCE)
@@ -2432,6 +2436,11 @@ bool QApplication::event(QEvent *e)
{
Q_D(QApplication);
if(e->type() == QEvent::Close) {
+#if defined(Q_OS_SYMBIAN)
+ // In order to have proper application-exit effects on Symbian, certain
+ // native APIs have to be called _before_ closing/destroying the widgets.
+ bool effectStarted = qt_beginFullScreenEffect();
+#endif
QCloseEvent *ce = static_cast<QCloseEvent*>(e);
ce->accept();
closeAllWindows();
@@ -2445,8 +2454,14 @@ bool QApplication::event(QEvent *e)
break;
}
}
- if(ce->isAccepted())
+ if (ce->isAccepted()) {
return true;
+ } else {
+#if defined(Q_OS_SYMBIAN)
+ if (effectStarted)
+ qt_abortFullScreenEffect();
+#endif
+ }
} else if(e->type() == QEvent::LanguageChange) {
#ifndef QT_NO_TRANSLATION
setLayoutDirection(qt_detectRTLLanguage()?Qt::RightToLeft:Qt::LeftToRight);
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index f73eb02..6620efd 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -1828,9 +1828,7 @@ void qt_init(QApplicationPrivate * /* priv */, int)
systemFont.setFamily(systemFont.defaultFamily());
QApplicationPrivate::setSystemFont(systemFont);
-#ifdef Q_SYMBIAN_TRANSITION_EFFECTS
QObject::connect(qApp, SIGNAL(aboutToQuit()), qApp, SLOT(_q_aboutToQuit()));
-#endif
#ifdef Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE
QApplicationPrivate::instance()->useTranslucentEGLSurfaces = true;
@@ -1855,6 +1853,8 @@ void qt_init(QApplicationPrivate * /* priv */, int)
} else {
QApplicationPrivate::instance()->useTranslucentEGLSurfaces = false;
}
+ if (QApplicationPrivate::graphics_system_name == QLatin1String("raster"))
+ QApplicationPrivate::instance()->useTranslucentEGLSurfaces = false;
#else
QApplicationPrivate::instance()->useTranslucentEGLSurfaces = false;
#endif
@@ -1919,6 +1919,9 @@ void qt_cleanup()
S60->setButtonGroupContainer(0);
#endif
+ // Call EndFullScreen() to prevent confusing the system effect state machine.
+ qt_endFullScreenEffect();
+
if (S60->qtOwnsS60Environment) {
// Restore the S60 framework trap handler. See qt_init().
User::SetTrapHandler(S60->s60InstalledTrapHandler);
@@ -2657,6 +2660,8 @@ void QApplication::restoreOverrideCursor()
void QApplicationPrivate::_q_aboutToQuit()
{
+ qt_beginFullScreenEffect();
+
#ifdef Q_SYMBIAN_TRANSITION_EFFECTS
// Send the shutdown tfx command
S60->wsSession().SendEffectCommand(ETfxCmdAppShutDown);
diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h
index e24405c..8aba53a 100644
--- a/src/gui/kernel/qt_s60_p.h
+++ b/src/gui/kernel/qt_s60_p.h
@@ -77,6 +77,10 @@
#include <akncontext.h> // CAknContextPane
#include <eikspane.h> // CEikStatusPane
#include <AknPopupFader.h> // MAknFadedComponent and TAknPopupFader
+#include <gfxtranseffect/gfxtranseffect.h> // BeginFullScreen
+#ifdef QT_SYMBIAN_HAVE_AKNTRANSEFFECT_H
+#include <akntranseffect.h> // BeginFullScreen
+#endif
#endif
QT_BEGIN_NAMESPACE
@@ -85,6 +89,9 @@ QT_BEGIN_NAMESPACE
// system events seems to start with 0x10
const TInt KInternalStatusPaneChange = 0x50000000;
+// For BeginFullScreen().
+const TUint KQtAppExitFlag = 0x400;
+
static const int qt_symbian_max_screens = 4;
//this macro exists because EColor16MAP enum value doesn't exist in Symbian OS 9.2
@@ -193,6 +200,9 @@ public:
int nativeScreenWidthInPixels;
int nativeScreenHeightInPixels;
+
+ int beginFullScreenCalled : 1;
+ int endFullScreenCalled : 1;
};
Q_AUTOTEST_EXPORT QS60Data* qGlobalS60Data();
@@ -334,6 +344,8 @@ inline QS60Data::QS60Data()
#ifdef Q_OS_SYMBIAN
,s60InstalledTrapHandler(0)
#endif
+ ,beginFullScreenCalled(0),
+ endFullScreenCalled(0)
{
}
@@ -565,6 +577,49 @@ void qt_symbian_set_cursor_visible(bool visible);
bool qt_symbian_is_cursor_visible();
#endif
+static inline bool qt_beginFullScreenEffect()
+{
+#if defined(Q_WS_S60) && defined(QT_SYMBIAN_HAVE_AKNTRANSEFFECT_H)
+ // Only for post-S^3. On earlier versions the system transition effects
+ // may not be able to capture the non-Avkon content, leading to confusing
+ // looking effects, so just skip the whole thing.
+ if (S60->beginFullScreenCalled || QSysInfo::s60Version() <= QSysInfo::SV_S60_5_2)
+ return false;
+ S60->beginFullScreenCalled = true;
+ // For Avkon apps the app-exit effect is triggered from CAknAppUi::PrepareToExit().
+ // That is good for Avkon apps, but in case of Qt the RWindows are destroyed earlier.
+ // Therefore we call BeginFullScreen() ourselves.
+ GfxTransEffect::BeginFullScreen(AknTransEffect::EApplicationExit,
+ TRect(0, 0, 0, 0),
+ AknTransEffect::EParameterType,
+ AknTransEffect::GfxTransParam(S60->uid,
+ AknTransEffect::TParameter::EAvkonCheck | KQtAppExitFlag));
+ return true;
+#else
+ return false;
+#endif
+}
+
+static inline void qt_abortFullScreenEffect()
+{
+#if defined(Q_WS_S60) && defined(QT_SYMBIAN_HAVE_AKNTRANSEFFECT_H)
+ if (!S60->beginFullScreenCalled || QSysInfo::s60Version() <= QSysInfo::SV_S60_5_2)
+ return;
+ GfxTransEffect::AbortFullScreen();
+ S60->beginFullScreenCalled = S60->endFullScreenCalled = false;
+#endif
+}
+
+static inline void qt_endFullScreenEffect()
+{
+#if defined(Q_WS_S60) && defined(QT_SYMBIAN_HAVE_AKNTRANSEFFECT_H)
+ if (S60->endFullScreenCalled || QSysInfo::s60Version() <= QSysInfo::SV_S60_5_2)
+ return;
+ S60->endFullScreenCalled = true;
+ GfxTransEffect::EndFullScreen();
+#endif
+}
+
QT_END_NAMESPACE
#endif // QT_S60_P_H