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

PinchHandler doesn't filter by number of fingers when receiving QNativeGestureEvents

    XMLWordPrintable

Details

    • Linux/Wayland
    • eb169146ceb8167214e0ea4f41b530fe8b2cc6a1 (qt/qtdeclarative/dev) 8fa28e11b1b6118d950a79ec91c7a46f85462b2a (qt/qtdeclarative/6.2)

    Description

      Can be reproduced with tests/manual/pointer/pinchHandler.qml : you can use a 3-finger pinch to manipulate PinchHandlers that are labeled as 2-finger pinch (although those don't have maximumPointCount declared), and you can't manipulate a 3-finger PinchHandler with an actual 3-finger pinch gesture. Being able to tell the number of fingers is a new feature on Wayland in 6.2, so we should now use QNativeGestureEvent::fingerCount() here:

      bool QQuickPinchHandler::wantsPointerEvent(QPointerEvent *event)
      {
          if (!QQuickMultiPointHandler::wantsPointerEvent(event))
              return false;
      
      #if QT_CONFIG(gestures)
          if (event->type() == QEvent::NativeGesture) {
              const auto gesture = static_cast<const QNativeGestureEvent *>(event);
              if (minimumPointCount() == 2) { // <---- that was an assumption
      

      Attachments

        For Gerrit Dashboard: QTBUG-95070
        # Subject Branch Project Status CR V

        Activity

          People

            srutledg Shawn Rutledge
            srutledg Shawn Rutledge
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes