Use non-blocking reads on virtual keyboard pps device.

Change-Id: Iad350c948049128f3014a6ad6536ac9dc2ee86d5
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com>
bb10
Sean Harmer 2012-04-26 09:49:27 +01:00 committed by Qt by Nokia
parent 15d4e943ba
commit 5c882dbb89
1 changed files with 6 additions and 1 deletions

View File

@ -58,7 +58,7 @@
QT_BEGIN_NAMESPACE
const char *QQnxVirtualKeyboard::ms_PPSPath = "/pps/services/input/control?wait";
const char *QQnxVirtualKeyboard::ms_PPSPath = "/pps/services/input/control";
const size_t QQnxVirtualKeyboard::ms_bufferSize = 2048;
// Huge hack for keyboard shadow (see QNX PR 88400). Should be removed ASAP.
@ -181,6 +181,11 @@ void QQnxVirtualKeyboard::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) > ms_bufferSize - 1) {
qCritical("QQnxVirtualKeyboard: Keyboard buffer size too short; need %u.", nread + 1);