summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas McGuire <thomas.mcguire.qnx@kdab.com>2012-10-05 13:21:37 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-12 00:19:36 (GMT)
commit0ef41ffa6f721d07f5dbb5f95004f118295d44f0 (patch)
treeb77c91500edd8d315bd1aec39d987142b0418bd6 /src
parent1774d800d9a14ed26e6be12b8461994ea38ed478 (diff)
downloadQt-0ef41ffa6f721d07f5dbb5f95004f118295d44f0.zip
Qt-0ef41ffa6f721d07f5dbb5f95004f118295d44f0.tar.gz
Qt-0ef41ffa6f721d07f5dbb5f95004f118295d44f0.tar.bz2
QNX: Fix input lag
We were breaking out of select() too early with a timeout of -1. This is a backport of qtbase commit ba8f3002d49d9941b2991fbe4d78883ea59827b2 Change-Id: I65e534caea665fea3d99de621bcdbcf7c47fac55 Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qeventdispatcher_blackberry.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_blackberry.cpp b/src/corelib/kernel/qeventdispatcher_blackberry.cpp
index 483171b..5711903 100644
--- a/src/corelib/kernel/qeventdispatcher_blackberry.cpp
+++ b/src/corelib/kernel/qeventdispatcher_blackberry.cpp
@@ -246,6 +246,14 @@ void QEventDispatcherBlackberry::unregisterSocketNotifier(QSocketNotifier *notif
static inline bool updateTimeout(int *timeout, const struct timeval &start)
{
+ // A timeout of -1 means we should block indefinitely. If we get here, we got woken up by a
+ // non-IO BPS event, and that event has been processed already. This means we can go back and
+ // block in bps_get_event().
+ // Note that processing the BPS event might have triggered a wakeup, in that case we get a
+ // IO event in the next bps_get_event() right away.
+ if (*timeout == -1)
+ return true;
+
if (Q_UNLIKELY(!QElapsedTimer::isMonotonic())) {
// we cannot recalculate the timeout without a monotonic clock as the time may have changed
return false;