diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2013-09-24 15:57:29 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-26 18:45:16 +0200 |
commit | 4ec31ce56adf6cd36cc7e31306fb9d0d1bb1b4f9 (patch) | |
tree | 66a516d626fb03af7903c83d48836313c95611b4 /src/platformsupport | |
parent | e120ad442d7ebff0b9862e8af9ebf9717b5ac92e (diff) |
evdevtouch: Avoid duplicating points in released state
Points in released state should only be removed from m_contacts after
the disappeared-since-last-sync is done. Otherwise the same point can
appear twice (both times in released state) in the same event.
Change-Id: Ia751054c3fe893006a090bdce96a64738d8388ac
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/platformsupport')
-rw-r--r-- | src/platformsupport/input/evdevtouch/qevdevtouch.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp index 08f9860ccf..a7502fbcc0 100644 --- a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp +++ b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp @@ -271,6 +271,7 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &specification, d->hw_pressure_max = absInfo.maximum; } } + char name[1024]; if (ioctl(m_fd, EVIOCGNAME(sizeof(name) - 1), name) >= 0) { d->hw_name = QString::fromLocal8Bit(name); @@ -452,9 +453,6 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data) } addTouchPoint(contact, &combinedStates); - - if (contact.state == Qt::TouchPointReleased) - it.remove(); } // Now look for contacts that have disappeared since the last sync. @@ -469,6 +467,15 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data) } } + // Remove contacts that have just been reported as released. + it = m_contacts; + while (it.hasNext()) { + it.next(); + Contact &contact(it.value()); + if (contact.state == Qt::TouchPointReleased) + it.remove(); + } + m_lastContacts = m_contacts; if (!m_typeB && !m_singleTouch) m_contacts.clear(); |