summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
diff options
context:
space:
mode:
authorRomain Pokrzywka <romain.pokrzywka@bluescape.com>2015-09-17 10:21:32 -0700
committerShawn Rutledge <shawn.rutledge@theqtcompany.com>2016-03-02 06:34:06 +0000
commit359546b069051213a7b337fefbe21b664618f959 (patch)
tree129df1ff2a1781106f36c9e057c2996d0abacde3 /src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
parent361142b5fcd199e7c301765b0dd16227cde71080 (diff)
evdevtouch: ensure touchpoints released with typeB mtdev drivers
This happens in one particular case: when the touchpoint corresponding to the last slot is reported as released and a new point is reported as pressed right after, so that both events happens within a same sync. In this case, there will be two ABS_MT_TRACKING_ID events received, first with -1 to report the released touchpoint, then with a new id to report the pressed touchpoint, then the SYN_REPORT afterwards. This results in m_contacts[m_currentSlot].state being updated to Qt::TouchPointReleased then Qt::TouchPointPressed, with the former never being reported during the handling of SYN_REPORT. To handle this scenario we need to inspect m_lastContacts for a change in tracking id for a particular slot combined with a non-null state, indicating that slot has not yet been reported released and processed in the previous sync. (the state for processed released points is reset to zero at the end of the SYN_REPORT handler) Task-number: QTBUG-51563 Change-Id: I01493008cf9f267e758d974dab29556d0a1425ea Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Diffstat (limited to 'src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp')
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
index ad348cc083..7cb4813c7b 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
+++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
@@ -531,9 +531,16 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data)
it.next();
Contact &contact(it.value());
int key = m_typeB ? it.key() : contact.trackingId;
- if (!m_contacts.contains(key)) {
- contact.state = Qt::TouchPointReleased;
- addTouchPoint(contact, &combinedStates);
+ if (m_typeB) {
+ if (contact.trackingId != m_contacts[key].trackingId && contact.state) {
+ contact.state = Qt::TouchPointReleased;
+ addTouchPoint(contact, &combinedStates);
+ }
+ } else {
+ if (!m_contacts.contains(key)) {
+ contact.state = Qt::TouchPointReleased;
+ addTouchPoint(contact, &combinedStates);
+ }
}
}