Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.7.3, 6.10.0
-
None
Description
The cursor fseq message seems to break the tracking of already placed tokens, only if a new token is added the already placed tokens will be tracked again.
Video showcasing the issue: Screen Recording 2025-03-20 at 15.50.39.mov
I think that the issue is not directly in the tuiotouch plugin, but rather somewhere in the event handling of the already placed tokens, as these tokens will be delivered to QWindowSystemInterface::handleTouchEvent(...) when moved in the simulator, but don't arrive in the MultiPointTouchArea where they are supposed to be further processed. However a workaround would be to also handle all tokens whenever a cursor fseq message is received, i.e.
void QTuioHandler::process2DCurFseq(const QOscMessage &message) { Q_UNUSED(message); // TODO: do we need to do anything with the frame id? QWindow *win = QGuiApplication::focusWindow(); if (!win && QGuiApplication::topLevelWindows().size() > 0 && forceDelivery) win = QGuiApplication::topLevelWindows().at(0); if (!win) return; QList<QWindowSystemInterface::TouchPoint> tpl; tpl.reserve(m_activeCursors.size() + m_deadCursors.size()); for (const QTuioCursor &tc : std::as_const(m_activeCursors)) { QWindowSystemInterface::TouchPoint tp = cursorToTouchPoint(tc, win); tpl.append(tp); } for (const QTuioCursor &tc : std::as_const(m_deadCursors)) { QWindowSystemInterface::TouchPoint tp = cursorToTouchPoint(tc, win); tp.state = QEventPoint::State::Released; tpl.append(tp); } /// NEW ---------------------------------------------------------------------------------------- /// NOTE: this here fixes the issue, but is there a better way? for (const QTuioToken & t : std::as_const(m_activeTokens)) { QWindowSystemInterface::TouchPoint tp = tokenToTouchPoint(t, win); tpl.append(tp); } for (const QTuioToken & t : std::as_const(m_deadTokens)) { QWindowSystemInterface::TouchPoint tp = tokenToTouchPoint(t, win); tp.state = QEventPoint::State::Released; tp.velocity = QVector2D(); tpl.append(tp); } /// -------------------------------------------------------------------------------------------- QWindowSystemInterface::handleTouchEvent(win, m_device, tpl); m_deadCursors.clear(); }
qtuiohandler.cpp seems to be working as intended, anyone has an idea where to look further?