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

delayed touch events aren't processed correctly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.5.3
    • QPA: Windows
    • None
    • Windows

      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.

        1. CMakeLists.txt
          2 kB
          roman
        2. mainwindow.h
          0.7 kB
          roman
        3. mainwindow.cpp
          3 kB
          roman
        4. main.cpp
          0.2 kB
          roman
        5. 0001-qwindowspointerhandler-remove-TouchPoint-if-GetPoint.patch
          1 kB
          roman
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            owolff Oliver Wolff
            schoebey roman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes