diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2010-11-12 14:33:33 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2010-11-12 14:33:33 (GMT) |
commit | 437e83e7707516129f68ee26aca5349845b7cc7b (patch) | |
tree | 0d4c8721f21acc5398e4eabff88a902cb23d0521 /src/gui/kernel | |
parent | 7b3880475d02bd3db630387bccccc7e1ef9d4e9a (diff) | |
parent | e61071a2a170eaeb524778e9e903100323b88bbe (diff) | |
download | Qt-437e83e7707516129f68ee26aca5349845b7cc7b.zip Qt-437e83e7707516129f68ee26aca5349845b7cc7b.tar.gz Qt-437e83e7707516129f68ee26aca5349845b7cc7b.tar.bz2 |
Merge remote branch 'origin/4.7' into qt-master-from-4.7
Conflicts:
configure
doc/src/snippets/code/doc_src_qmake-manual.qdoc
mkspecs/features/symbian/application_icon.prf
mkspecs/features/symbian/default_post.prf
mkspecs/features/symbian/symbian_building.prf
qmake/generators/symbian/initprojectdeploy_symbian.cpp
src/multimedia/audio/audio.pri
src/network/access/qnetworkaccessmanager.cpp
src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
src/opengl/qgl_p.h
src/plugins/bearer/corewlan/qcorewlanengine.mm
src/plugins/phonon/mmf/mmf.pro
tests/auto/qscriptvalue/tst_qscriptvalue.cpp
tests/auto/qscriptvalue/tst_qscriptvalue.h
tools/qdoc3/doc/qdoc-manual.qdocconf
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qeventdispatcher_s60.cpp | 66 | ||||
-rw-r--r-- | src/gui/kernel/qeventdispatcher_s60_p.h | 24 | ||||
-rw-r--r-- | src/gui/kernel/qgesturemanager.cpp | 4 | ||||
-rw-r--r-- | src/gui/kernel/qmotifdnd_x11.cpp | 5 |
5 files changed, 99 insertions, 2 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 96856b8..f352871 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1425,7 +1425,7 @@ void qt_init(QApplicationPrivate * /* priv */, int) TInt err = CApaCommandLine::GetCommandLineFromProcessEnvironment(commandLine); // After this construction, CEikonEnv will be available from CEikonEnv::Static(). // (much like our qApp). - CEikonEnv* coe = new CEikonEnv; + QtEikonEnv* coe = new QtEikonEnv; //not using QT_TRAP_THROWING, because coe owns the cleanupstack so it can't be pushed there. if(err == KErrNone) TRAP(err, coe->ConstructAppFromCommandLineL(factory,*commandLine)); diff --git a/src/gui/kernel/qeventdispatcher_s60.cpp b/src/gui/kernel/qeventdispatcher_s60.cpp index bc787b8..77ebd0d 100644 --- a/src/gui/kernel/qeventdispatcher_s60.cpp +++ b/src/gui/kernel/qeventdispatcher_s60.cpp @@ -45,6 +45,62 @@ QT_BEGIN_NAMESPACE +QtEikonEnv::QtEikonEnv() + : m_lastIterationCount(0) + , m_savedStatusCode(KRequestPending) + , m_hasAlreadyRun(false) +{ +} + +QtEikonEnv::~QtEikonEnv() +{ +} + +void QtEikonEnv::RunL() +{ + QEventDispatcherS60 *dispatcher = qobject_cast<QEventDispatcherS60 *>(QAbstractEventDispatcher::instance()); + if (!dispatcher) { + CEikonEnv::RunL(); + return; + } + + if (m_lastIterationCount != dispatcher->iterationCount()) { + m_hasAlreadyRun = false; + m_lastIterationCount = dispatcher->iterationCount(); + } + + if (m_hasAlreadyRun) { + // Fool the active scheduler into believing we are still waiting for events. + // The window server thinks we are not, however. + m_savedStatusCode = iStatus.Int(); + iStatus = KRequestPending; + SetActive(); + dispatcher->queueDeferredActiveObjectsCompletion(); + } else { + m_hasAlreadyRun = true; + CEikonEnv::RunL(); + } +} + +void QtEikonEnv::DoCancel() +{ + complete(); + + CEikonEnv::DoCancel(); +} + +void QtEikonEnv::complete() +{ + if (m_hasAlreadyRun) { + if (m_savedStatusCode != KRequestPending) { + TRequestStatus *status = &iStatus; + QEventDispatcherSymbian::RequestComplete(status, m_savedStatusCode); + m_savedStatusCode = KRequestPending; + } + m_hasAlreadyRun = false; + } +} + QEventDispatcherS60::QEventDispatcherS60(QObject *parent) : QEventDispatcherSymbian(parent), m_noInputEvents(false) @@ -127,4 +183,14 @@ void QEventDispatcherS60::removeInputEventsForWidget(QObject *object) } } +// reimpl +void QEventDispatcherS60::reactivateDeferredActiveObjects() +{ + if (S60->qtOwnsS60Environment) { + static_cast<QtEikonEnv *>(CCoeEnv::Static())->complete(); + } + + QEventDispatcherSymbian::reactivateDeferredActiveObjects(); +} + QT_END_NAMESPACE diff --git a/src/gui/kernel/qeventdispatcher_s60_p.h b/src/gui/kernel/qeventdispatcher_s60_p.h index d2f327c..c14fef0 100644 --- a/src/gui/kernel/qeventdispatcher_s60_p.h +++ b/src/gui/kernel/qeventdispatcher_s60_p.h @@ -56,8 +56,30 @@ #include <private/qeventdispatcher_symbian_p.h> #include "qt_s60_p.h" +#include <eikenv.h> + QT_BEGIN_NAMESPACE +class QEventDispatcherS60; + +class QtEikonEnv : public CEikonEnv +{ +public: + QtEikonEnv(); + ~QtEikonEnv(); + + // from CActive. + void RunL(); + void DoCancel(); + + void complete(); + +private: + int m_lastIterationCount; + TInt m_savedStatusCode; + bool m_hasAlreadyRun; +}; + class Q_GUI_EXPORT QEventDispatcherS60 : public QEventDispatcherSymbian { Q_OBJECT @@ -73,6 +95,8 @@ public: void saveInputEvent(QSymbianControl *control, QWidget *widget, QInputEvent *event); + void reactivateDeferredActiveObjects(); + private: bool sendDeferredInputEvents(); diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp index 8dd2db7..5f1bb85 100644 --- a/src/gui/kernel/qgesturemanager.cpp +++ b/src/gui/kernel/qgesturemanager.cpp @@ -171,6 +171,10 @@ void QGestureManager::cleanupCachedGestures(QObject *target, Qt::GestureType typ foreach (QGesture *g, gestures) { m_deletedRecognizers.remove(g); m_gestureToRecognizer.remove(g); + m_maybeGestures.remove(g); + m_activeGestures.remove(g); + m_gestureOwners.remove(g); + m_gestureTargets.remove(g); } qDeleteAll(gestures); diff --git a/src/gui/kernel/qmotifdnd_x11.cpp b/src/gui/kernel/qmotifdnd_x11.cpp index 3334455..3b79129 100644 --- a/src/gui/kernel/qmotifdnd_x11.cpp +++ b/src/gui/kernel/qmotifdnd_x11.cpp @@ -385,7 +385,10 @@ static void DndReadSourceProperty(Display * dpy, static void DndWriteReceiverProperty(Display * dpy, Window window, unsigned char protocol_style) { - DndReceiverProp receiver_prop ; + DndReceiverProp receiver_prop; + + // squelch potential valgrind errors about uninitialized reads + memset(&receiver_prop, 0, sizeof(receiver_prop)); receiver_prop.byte_order = DndByteOrder() ; receiver_prop.protocol_version = DND_PROTOCOL_VERSION; |