diff options
author | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2013-08-01 13:40:36 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-08-19 14:24:28 +0200 |
commit | 7495b59dbda45049ba54f3682904962c217a9906 (patch) | |
tree | cdb0c467285771a048513541b4d4b72e26053c5f /src/plugins/platforms | |
parent | 76f32cadb227a8d0a0371e518b9ad99344acf44f (diff) |
xcb: Fix TouchPointPressed being sent multiple times.
XI2 sends events for individual touch points, but QTouchEvent
sends all of them with a stationary state if they didn't change.
If a touch pressed event is received, and the next XI2 event
is about a different touch point, we wouldn't update the state
of the previously pressed touch point.
Change-Id: I1ebcbea1cea54872064ef7710e2aac7b0b41cd70
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp index 991c82eaaa..799bb387e1 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp @@ -309,8 +309,6 @@ void QXcbConnection::xi2HandleEvent(xcb_ge_event_t *event) case XI_TouchUpdate: if (touchPoint.area.center() != QPoint(x, y)) touchPoint.state = Qt::TouchPointMoved; - else - touchPoint.state = Qt::TouchPointStationary; break; case XI_TouchEnd: touchPoint.state = Qt::TouchPointReleased; @@ -323,9 +321,13 @@ void QXcbConnection::xi2HandleEvent(xcb_ge_event_t *event) " area " << touchPoint.area << " pressure " << touchPoint.pressure; #endif QWindowSystemInterface::handleTouchEvent(platformWindow->window(), xiEvent->time, dev->qtTouchDevice, m_touchPoints.values()); - // If a touchpoint was released, we can forget it, because the ID won't be reused. if (touchPoint.state == Qt::TouchPointReleased) + // If a touchpoint was released, we can forget it, because the ID won't be reused. m_touchPoints.remove(touchPoint.id); + else + // Make sure that we don't send TouchPointPressed/Moved in more than one QTouchEvent + // with this touch point if the next XI2 event is about a different touch point. + touchPoint.state = Qt::TouchPointStationary; } } #endif |