diff options
author | Jeremy Katz <jeremy.katz@nokia.com> | 2010-05-19 09:15:21 (GMT) |
---|---|---|
committer | Jeremy Katz <jeremy.katz@nokia.com> | 2010-05-19 09:15:21 (GMT) |
commit | 8ace0f0b97a4b321037e034b35b6342cf0e779cf (patch) | |
tree | 5c48f9edb69e5a317350c784b3eb6f887ec9af14 /src/gui | |
parent | 3cd3206cdaf4b1cf0ccf50b2d0a7d67a68be582e (diff) | |
download | Qt-8ace0f0b97a4b321037e034b35b6342cf0e779cf.zip Qt-8ace0f0b97a4b321037e034b35b6342cf0e779cf.tar.gz Qt-8ace0f0b97a4b321037e034b35b6342cf0e779cf.tar.bz2 |
fix event dispatcher sleep problem on Android
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/kernel/qapplication_p.h | 3 | ||||
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface.cpp | 12 | ||||
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface.h | 2 |
3 files changed, 16 insertions, 1 deletions
diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h index 7202ae5..7ad8ca5 100644 --- a/src/gui/kernel/qapplication_p.h +++ b/src/gui/kernel/qapplication_p.h @@ -322,6 +322,9 @@ public: #if defined(Q_WS_LITE) static QPlatformIntegration *platformIntegration() { return platform_integration; } + + static QAbstractEventDispatcher *qt_lite_core_dispatcher() + { return QCoreApplication::instance()->d_func()->threadData->eventDispatcher; } #endif void createEventDispatcher(); diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp index 05ca3d3..22b45ac 100644 --- a/src/gui/kernel/qwindowsysteminterface.cpp +++ b/src/gui/kernel/qwindowsysteminterface.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ #include "qwindowsysteminterface.h" #include "qapplication_p.h" +#include <QAbstractEventDispatcher> QT_BEGIN_NAMESPACE @@ -121,4 +122,15 @@ QWindowSystemInterface::UserEvent * QWindowSystemInterfacePrivate::getUserEvent( queueMutex.unlock(); return ret; } + +void QWindowSystemInterfacePrivate::queueUserEvent(QWindowSystemInterface::UserEvent *ev) +{ + queueMutex.lock(); + userEventQueue.append(ev); + queueMutex.unlock(); + + QAbstractEventDispatcher *dispatcher = QApplicationPrivate::qt_lite_core_dispatcher(); + if (dispatcher) + dispatcher->wakeUp(); +} QT_END_NAMESPACE diff --git a/src/gui/kernel/qwindowsysteminterface.h b/src/gui/kernel/qwindowsysteminterface.h index d9bfc70..e0c46d1 100644 --- a/src/gui/kernel/qwindowsysteminterface.h +++ b/src/gui/kernel/qwindowsysteminterface.h @@ -133,7 +133,7 @@ public: static int userEventsQueued() { queueMutex.lock(); int ret = userEventQueue.count(); queueMutex.unlock(); return ret; } static QWindowSystemInterface::UserEvent * getUserEvent(); - static void queueUserEvent(QWindowSystemInterface::UserEvent *ev) { queueMutex.lock(); userEventQueue.append(ev); queueMutex.unlock(); } + static void queueUserEvent(QWindowSystemInterface::UserEvent *ev); }; QT_END_NAMESPACE |