Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.9.0, 5.12.0
-
None
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.