-
Bug
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
6.5.3
-
None
if somewhere in the code, there's a loop that calls
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
and during one of those process events, touch events received, they are stored in QEventDispatcherWin32::d->queuedUserInputEvents for later processing.
As soon as the code returns back to the 'regular' event loop, the stored events are processed and eventually get passed to QWindowsPointerHandler::translatePointerEvent.
There, the pointer type is queried using the WinAPI call "GetPointerType" - which promptly fails, presumably because the queried identifier is no longer available. The line GetPointerType() failed: "The operation completed successfully." should appear in the debug output.
The result of this is that the touch point of the QEvent::TouchBegin is never removed from m_lastTouchPoints, which results in all future touch events having a superfluous touch point. Single finger touch events result in two finger touch events, preventing the user from scrolling, panning, etc.
The code in question is this (in qwindowspointerhandler.cpp):
if (!GetPointerType(pointerId, &m_pointerType)) { qWarning() << "GetPointerType() failed:" << qt_error_string(); return false; }
Removing pointerId from m_lastTouchPoints should fix the issue.
Attached is a sample program that lets you reproduce the bug by double tapping on the button, then after waiting for 2s, tapping the label to the right of the button. The log should output the number of detected touch points. This should always be 1, but after a double tap, the number usually goes up by one.