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

Wrong QEvent::TouchBegin and QEvent::MouseMove events on initial swipe

    XMLWordPrintable

Details

    • Windows
    • 8ada0633cd58e0608df2e16880f1293286025504

    Description

      Run the attached sample.

      Swipe the finger vertically and release it.

      You should get a log similar to this, where we get two TouchBegin events in the beginning...

      2.968 main.cpp(115):TouchBegin
      2.969 main.cpp(115):MouseMove (MouseEventSynthesizedByQt)
      2.973 main.cpp(115):TouchBegin
      2.973 main.cpp(115):MouseButtonPress (MouseEventSynthesizedByQt)
      2.974 main.cpp(115):TouchUpdate
      2.974 main.cpp(115):MouseMove (MouseEventSynthesizedByQt)
      2.985 main.cpp(115):TouchUpdate
      2.986 main.cpp(115):MouseMove (MouseEventSynthesizedByQt)
      [....]
      3.368 main.cpp(115):TouchUpdate
      3.371 main.cpp(115):MouseMove (MouseEventSynthesizedByQt)
      3.393 main.cpp(115):TouchUpdate
      3.397 main.cpp(115):MouseMove (MouseEventSynthesizedByQt)
      3.421 main.cpp(115):MouseMove (MouseEventSynthesizedByQt)
      3.425 main.cpp(115):TouchEnd
      3.429 main.cpp(115):MouseButtonRelease (MouseEventSynthesizedByQt)

      The first one seems to be wrong. It is actually because the actual system event is WM_POINTERENTER. And when QWindowsPointerHandler::translateTouchEvent() delivers the touch event it deduces the type of touch event by examining the state of the touchpoints. So the touch event will be ultimately be delivered as TouchBegin.

      Next, it will try to deliver the mouse event, but the call to getMouseEventInfo() results in that  eventType becomes QEvent::None. That type is passed on to QWindowSystemInterface::handleMouseEvent(), and it will eventually end up in QGuiApplicationPrivate::processMouseEvent(), and deduce that the event should be of type QEvent::MouseMove. This is why the first two events are TouchBegin and MouseMove. I believe they should not be there.

      Maybe the call to translateTouchEvent() in QWindowsPointerHandler::translatePointerEvent() should be surrounded by check on the msg.message instead of just checking the pointerType. It seems that translateTouchEvent() should only be responsible for sending TouchBegin TouchUpdate TouchEnd (or MousePress, MouseMove, MouseRelease) events.

       

      Attachments

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

        Activity

          People

            anrocha André De La Rocha (Inactive)
            smd Jan Arve
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes