summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKevin Krammer <kevin.krammer.qnx@kdab.com>2012-04-26 09:11:47 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-04-26 16:11:07 (GMT)
commitc507e783c931b74a3f200fa824fa9e9fee78ba9f (patch)
tree12fc82121424781e692b86bfbc9d7e864dca5a49 /src
parentf1a55ad65337bb614c3dd6e723554bded72a28e4 (diff)
downloadQt-c507e783c931b74a3f200fa824fa9e9fee78ba9f.zip
Qt-c507e783c931b74a3f200fa824fa9e9fee78ba9f.tar.gz
Qt-c507e783c931b74a3f200fa824fa9e9fee78ba9f.tar.bz2
Use non-blocking reads on virtual keyboard pps device.
Backport of 5c882dbb8955e3bcbd77027aae379aca50e9dfaa Change-Id: Ic9724138775cc2a33ec8a3279950c1332b9adbcf Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/blackberry/qbbvirtualkeyboard.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/platforms/blackberry/qbbvirtualkeyboard.cpp b/src/plugins/platforms/blackberry/qbbvirtualkeyboard.cpp
index 0842684..a10b122 100644
--- a/src/plugins/platforms/blackberry/qbbvirtualkeyboard.cpp
+++ b/src/plugins/platforms/blackberry/qbbvirtualkeyboard.cpp
@@ -61,7 +61,7 @@
QT_BEGIN_NAMESPACE
-const char *QBBVirtualKeyboard::sPPSPath = "/pps/services/input/control?wait";
+const char *QBBVirtualKeyboard::sPPSPath = "/pps/services/input/control";
const size_t QBBVirtualKeyboard::sBufferSize = 2048;
// Huge hack for keyboard shadow (see QNX PR 88400). Should be removed ASAP.
@@ -185,6 +185,11 @@ void QBBVirtualKeyboard::ppsDataReady()
return;
}
+ // We sometimes get spurious read notifications when no data is available.
+ // Bail out early in this case
+ if (nread == 0)
+ return;
+
// nread is the real space necessary, not the amount read.
if (static_cast<size_t>(nread) > sBufferSize - 1) {
qCritical("QBBVirtualKeyboard: Keyboard buffer size too short; need %u.", nread + 1);