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

Drawer stops responding to touch input

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • 6.2.2
    • Quick: Controls 2
    • None
    • Embedded Linux with touch display
    • Linux/Other display system

    Description

      I have a QML Drawer that pulls down a status overview. The Drawer contains a ListView with a long list of status information.

      Sometimes, after scrolling in the ListView, the Drawer stops responding to touch input and can't be closed.

       

      I have found that when the Drawer is in a non-responsive state that 
      QQuickPopupPrivate::touchId is set to an old value which was never cleared.
       
      This means that all touch events are ignored in QQuickPopupPrivate::handleTouchEvent due to a check inQQuickPopupPrivate::acceptTouch
       

      bool QQuickPopupPrivate::handleTouchEvent(QQuickItem *item, QTouchEvent *event)
      ...
      if (!acceptTouch(point))  <---- returns false
          return blockInput(item, point.position());
      
      switch (point.state()) {
      case QEventPoint::Pressed:
          return handlePress(...);
      case QEventPoint::Updated:
          return handleMove(...);
      case QEventPoint::Released:
          return handleRelease(...);
      default:
          break;
      }
      
      bool QQuickPopupPrivate::acceptTouch(const QTouchEvent::TouchPoint &point)
      {
          if (point.id() == touchId)  <---- touchId has wrong value
              return true;
          if (touchId == -1 && point.state() != QEventPoint::Released) {
              touchId = point.id();
              return true;
          }
          return false;
      }
      

      touchId is supposed to be set to -1 in QQuickPopupPrivate::handleRelease, but that is never called because pressPoint is not set.
       

      bool QQuickDrawerPrivate::handleRelease(QQuickItem *item, const QPointF &point, ulong timestamp)
      {
          if (pressPoint.isNull()) <--- pressPoint is not set
              return false;
          if (!popupItem->keepMouseGrab() && !popupItem->keepTouchGrab()) {
              velocityCalculator.reset();
              return QQuickPopupPrivate::handleRelease(item, point, timestamp); <-- Never gets called
          }
      ...

      pressPoint is not set because the Drawer never receives the Pressed event.
      I don't know why the Drawer sometimes don't receive the Pressed event, perhaps the ListView is stealing it. I havn't figured that out yet.
       
      So what happens is that  # QEventPoint::Pressed event never comes

      1. the QEventPoint::Updated does arrive
      2. acceptTouch is called, finds that touchId==-1, and touchId is set. note at this time pressPoint was not set.
      3. QEventPoint::Released event arrives, but is ignored because pressPoint==0. touchId is left with the old value.
      4. The Drawer is now in the non-responsive state.
         
        There should probably be a change so that touchId is not set if pressPoint.IsNull() is true. or is only set in the Pressed event.
         
         

      Attachments

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

        Activity

          People

            riksvep Fredrik Redgård
            riksvep Fredrik Redgård
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes