diff options
author | axis <qt-info@nokia.com> | 2010-11-01 16:05:18 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2010-11-05 09:24:01 (GMT) |
commit | e7d505e35666393ea965e41c59742f609344e858 (patch) | |
tree | 688166201683a332ef81d4c8a17d1cd4c9c398f1 /src/corelib/kernel | |
parent | 55497edc83121317078d62083a835f2b794b37e4 (diff) | |
download | Qt-e7d505e35666393ea965e41c59742f609344e858.zip Qt-e7d505e35666393ea965e41c59742f609344e858.tar.gz Qt-e7d505e35666393ea965e41c59742f609344e858.tar.bz2 |
Fixed event starvation with pointer events on Symbian.
The CEikonEnv active object is used by Symbian to indicate that new
window server events are available, in this case pointer events.
Since this object was being controlled by Symbian, it was not subject
to Qt's round robin queue. In a case where the event handler for the
pointer event would take very long, it was possible for the active
object to be completed again before the previous handler was
finished, causing it to be called in a loop.
This was fixed by making a new Qt-owned class as a subclass of
CEikonEnv, and in its RunL, make sure that the object follows the
round-robin queue.
Because the round robin code is located in a subclass of CEikonEnv
that we own, the fix will have no effect if Qt is loaded after the
Eikon framework (such as a Qt plugin in a non-Qt app).
Task: QT-4077
RevBy: mread
AutoTest: N/A, system events
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r-- | src/corelib/kernel/qeventdispatcher_symbian.cpp | 9 | ||||
-rw-r--r-- | src/corelib/kernel/qeventdispatcher_symbian_p.h | 4 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp index d8cc344..bb9bd01 100644 --- a/src/corelib/kernel/qeventdispatcher_symbian.cpp +++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp @@ -975,9 +975,7 @@ bool QEventDispatcherSymbian::sendPostedEvents() inline void QEventDispatcherSymbian::addDeferredActiveObject(QActiveObject *object) { - if (m_deferredActiveObjects.isEmpty()) { - m_completeDeferredAOs->complete(); - } + queueDeferredActiveObjectsCompletion(); m_deferredActiveObjects.append(object); } @@ -986,6 +984,11 @@ inline void QEventDispatcherSymbian::removeDeferredActiveObject(QActiveObject *o m_deferredActiveObjects.removeAll(object); } +void QEventDispatcherSymbian::queueDeferredActiveObjectsCompletion() +{ + m_completeDeferredAOs->complete(); +} + void QEventDispatcherSymbian::reactivateDeferredActiveObjects() { while (!m_deferredActiveObjects.isEmpty()) { diff --git a/src/corelib/kernel/qeventdispatcher_symbian_p.h b/src/corelib/kernel/qeventdispatcher_symbian_p.h index 1486db5..3615996 100644 --- a/src/corelib/kernel/qeventdispatcher_symbian_p.h +++ b/src/corelib/kernel/qeventdispatcher_symbian_p.h @@ -247,7 +247,9 @@ public: void addDeferredActiveObject(QActiveObject *object); void removeDeferredActiveObject(QActiveObject *object); - void reactivateDeferredActiveObjects(); + void queueDeferredActiveObjectsCompletion(); + // Can be overridden to activate local active objects too, but do call baseclass! + virtual void reactivateDeferredActiveObjects(); inline int iterationCount() const { return m_iterationCount; } |