Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
5.15.0
-
-
3ee57b838 (dev), 8e0bf6e05 (dev), c17a1432c (6.6), bd188231a (6.5)
-
Foundation Sprint 91, Foundation Sprint 92
Description
If the pen is tap up from the touch screen when there are still have a finger on it , android os will send the ACTION_POINTER_UP event to main activity but not a ACTION_UP event.But the tablet event processed code does not cover this case.So that we will lost the Tablet Release Event .
// Issue occured code block
static void tabletEvent(JNIEnv */*env*/, jobject /*thiz*/, jint /*winId*/, jint deviceId, jlong time, jint action, jint pointerType, jint buttonState, jfloat x, jfloat y, jfloat pressure) { QPointF globalPosF(x, y); QPoint globalPos((int)x, (int)y); QWindow *tlw = topLevelWindowAt(globalPos); QPointF localPos = tlw ? (globalPosF - tlw->position()) : globalPosF; // when action == ACTION_UP (1) it's a release; otherwise we say which button is pressed Qt::MouseButtons buttons = Qt::NoButton; switch (action) { case 1: // ACTION_UP case 212: // stylus release while side-button held on Galaxy Note 4 buttons = Qt::NoButton; break; default: // action is press or drag if (buttonState == 0) buttons = Qt::LeftButton; else // 2 means RightButton buttons = Qt::MouseButtons(buttonState); break; } QWindowSystemInterface::handleTabletEvent(tlw, ulong(time), localPos, globalPosF, QTabletEvent::Stylus, pointerType, buttons, pressure, 0, 0, 0., 0., 0, deviceId, Qt::NoModifier); }
One way to fix it
// add this line into QtNative.java at line 616.
int actionType = event.getAction(); if( actionType == 6 ) Hanlde the ACTION_POINTER_UP { actionType = 1;//Mark the ACTION_POINTER_UP as ACTION_UP } tabletEvent(id, event.getDeviceId(), event.getEventTime(), actionType , pointerType, event.getButtonState(), event.getX(), event.getY(), event.getPressure());
Attachments
Issue Links
- relates to
-
QTBUG-85386 Qt Android has the bad performance with 4K WhiteBoard
- Closed
-
QTBUG-89120 Act the touch and pen at the same time , a lot of touch event will filter out
- Closed
For Gerrit Dashboard: QTBUG-86297 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
504716,3 | Handle ACTION_POINTER_UP with tablet events | dev | qt/qtbase | Status: MERGED | +2 | 0 |
507881,5 | Make tests/manual/qtabletevent/device_information build standalone | dev | qt/qtbase | Status: MERGED | +2 | 0 |
510697,2 | Handle ACTION_POINTER_UP with tablet events | 6.6 | qt/qtbase | Status: MERGED | +2 | 0 |
511423,2 | Handle ACTION_POINTER_UP with tablet events | 6.5 | qt/qtbase | Status: MERGED | +2 | 0 |