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

Swiping gestures don't work on some Android devices

    XMLWordPrintable

Details

    • Android

    Description

      Swiping (scrolling, zooming and etc) gestures are not working on some recent Android devices.

      The problem was reported by our users with Doogee X70 and Blackview A30. It is not known how many other device models are affected.

      All other (non-Qt) applications work on the same devices correctly.

      The research found that the problem lays in src/android/jar/src/org/qtproject/qt5/android/QtNative.java:

      static private int getAction(int index, MotionEvent event)
      ....            int hsz = event.getHistorySize();
                  if (hsz > 0) {
                      float x = event.getX(index);
                      float y = event.getY(index);
                      for (int h = 0; h < hsz; ++h) {
                          if ( event.getHistoricalX(index, h) != x ||
                               event.getHistoricalY(index, h) != y )
                              return 1;
                      }
                      return 2; <======== RETURNS HERE
                  }
       

      The devices send touch move event with 1-element history that matches the lastest (x, y) so the filter assumes that the point was in fact stationary.

      The bug can be fixed either by changing "if (hsz > 0)" to "if (hsz > 1)" or by just removing the history-based filtering completely as it doesn't do much useful anyway. Unfortunately the commit history does not contain information why it was even added there.

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes