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

GestureRecognizer can not get Touch Update if consume Touch Begin

    XMLWordPrintable

Details

    • Linux/X11

    Description

      I'm porting my code from Qt 5.12 to the dev branch.

      But I'm finding that in the dev branch, if I consume TouchBegin event in QGestureRecognizer::recognize(), I can't receive subsequent Touch Update events in recognize. And it's ok in Qt 5.12.8.

      I found that commit dad1e1494128ff963b2a38870c44081f493f1e54 of dev branch caused this problem.

      -            QMutableEventPoint::from(touchPoint).setTarget(target);
      +            // on touch pads, implicitly grab all touch points
      +            // on touch screens, grab touch points that are redirected to the closest widget
      +            if (device->type() == QInputDevice::DeviceType::TouchPad || usingClosestWidget)
      +                QMutableEventPoint::from(touchPoint).setTarget(target); 

      In the new version, QApplicationPrivate::translateRawTouchEvent does not set a target for the touchpoint when the TouchBegin event occurs, and when the TouchUpdate event occurs, the TouchUpdate event without target cannot find the context in the gesture manager. Therefore, it will not be sent to QGestureRecognizer::recognize.

      If you wish to reproduce this problem, try returning ConsumeEventHint for TouchBegin event in QFlickGestureRecognizer::recognize, and you will find that QFlickGestureRecognizer::recognize will no longer receive the TouchUpdate event.

      Attachments

        Issue Links

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

          Activity

            People

              srutledg Shawn Rutledge
              weiwei WeiNan Wang
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes