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
parent
15d4e943ba
commit
5c882dbb89
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue