Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-134982

tuiotouch: tokens no longer tracked after cursor pressed

    XMLWordPrintable

Details

    • macOS

    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?

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            srutledg Shawn Rutledge
            2n3l Niklas Nell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes