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

PointHandler can get locked in a passive grab, breaking it until the application is restarted

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P1: Critical
    • None
    • 6.4.3, 6.5.0
    • None
    • Linux/X11

    Description

      When using a PointHandler inside a Rectangle (which does contain only a separate DragHandler) with touch events, it is very easy to get into the following situation:
      ```
      QQuickPointHandler(0x563111243900) QEventPoint(id=1190 ts=15068991 pos=458.929,212.487 scn=468.929,432.487 gbl=540.929,496.487 Pressed vel=0,0 press=458.929,212.487 last=458.929,212.487 Δ 0,0) true via QQuickDeliveryAgent(root=QQuickRootItem)

      QEventPoint(id=1190 ts=15068991 pos=458.929,212.487 scn=468.929,432.487 gbl=540.929,496.487 Pressed vel=0,0 press=458.929,212.487 last=458.929,212.487 Δ 0,0) QPointingDevice::GrabPassive QQuickPointHandler(0x563111243900)

      QQuickPointHandler(0x563111243900) pointId 4a6 is missing from current event, but was neither canceled nor released
      ```
      This breaks the pointer handler indefinitely, until either the qml component is reloaded, if one was lucky enough to have it in a loader, or the client is restarted. I would expect such invalid events to be discarded from the PointerHandler - so the user loses some of his touch input on invalid interactions, but at least can continue using the software afterwards.

      What would be a good way to fix/mitigate this issue? It is reprodusible within the first 30secs to a minute of random clicking inside the item within the Area of the PointHandler.

      I already tried wrapping it in a MouseArea, as some forum posts suggest, which did nothing.

      Here is my simple setup:
      ```

      Item {
      id: control
      PointHandler {
      id: selectionRectangleHandler

      // Any TakeOvers should be explicitly forbidden. Otherwise touch events break regularly
      grabPermissions: PointerHandler.TakeOverForbidden

      target: Rectangle

      { id: selectionRectangle x: Math.min(dragEndPoint.x, dragStartPoint.x) y: Math.min(dragEndPoint.y, dragStartPoint.y) // and some bindings for width and height to draw it from start to end parent: control visible: selectionRectangleHandler.active property point dragStartPoint property point dragEndPoint }

      onPointChanged: {
      if (active)

      { selectionRectangle.dragEndPoint = this.point.position }

      }

      onGrabChanged: (transition, point) => {
      if (point.state & Qt.TouchPointPressed)

      { selectionRectangle.dragStartPoint = point.position }

      // Most of the grabs here are passive and passive ungrabs are never delivered for touch events, which seems to be the problem
      }

      onActiveChanged: {
      if (!active)

      { // Selects Items in rectangle when released }

      }
      }
      }
      ```

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              r.vitanov Rosen Vitanov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes