From 462410a08b8bbfb068b6e06573adb0701c527d06 Mon Sep 17 00:00:00 2001 From: Valery Volgutov Date: Fri, 22 Jan 2021 18:47:30 +0300 Subject: [PATCH] evdevtouch: Fix wrong addTouchPoint for "mtdev" Origin patch 359546b069051213a7b337fefbe21b664618f959 has following rule: "the state for processed released points is reset to zero at the end of the SYN_REPORT handler" Patch 4e400369c08db251cd489fec1229398c224d02b4 changed state according new event refactor, but not fully. Task-number: QTBUG-86013 Pick-to: 5.15 6.0 6.1 Change-Id: If35b756d5c726533f11d18e7b73c98fffa17d809 Reviewed-by: Shawn Rutledge --- .../input/evdevtouch/qevdevtouchhandler.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp index cf2f300207..eb693426d9 100644 --- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp +++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp @@ -589,8 +589,10 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data) for (auto it = m_contacts.begin(), end = m_contacts.end(); it != end; /*erasing*/) { Contact &contact(it.value()); - if (!contact.state) + if (!contact.state) { + ++it; continue; + } int key = m_typeB ? it.key() : contact.trackingId; if (!m_typeB && m_lastContacts.contains(key)) { @@ -641,12 +643,14 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data) for (auto it = m_contacts.begin(), end = m_contacts.end(); it != end; /*erasing*/) { Contact &contact(it.value()); - if (!contact.state) + if (!contact.state) { + ++it; continue; + } if (contact.state == QEventPoint::State::Released) { if (m_typeB) { - contact.state = QEventPoint::State::Stationary; + contact.state = QEventPoint::State::Unknown; } else { it = m_contacts.erase(it); continue;