diff options
author | Andras Becsi <andras.becsi@digia.com> | 2014-11-27 13:18:49 +0100 |
---|---|---|
committer | Andras Becsi <andras.becsi@digia.com> | 2014-11-27 13:19:25 +0100 |
commit | 8c6f087296ec48790c3efd9564c1056802b4c9c0 (patch) | |
tree | da343f4ecd843a0ff83ef3f584cb62d9188dab5c /src/core/render_widget_host_view_qt.cpp | |
parent | aa1b2d20a80f53ce5e7f6097114d41a018d9350b (diff) | |
parent | c5957ac90cbaccccbd58b3fc73f94cf0d4795e54 (diff) |
Merge remote-tracking branch 'origin/5.4.0' into 5.4
Change-Id: I2c48688f5f034233660bd7891693f81525fc1d6d
Diffstat (limited to 'src/core/render_widget_host_view_qt.cpp')
-rw-r--r-- | src/core/render_widget_host_view_qt.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index 2cc5510ae..c221e94e3 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -133,6 +133,12 @@ static inline ui::GestureProvider::Config QtGestureProviderConfig() { return config; } +static inline bool compareTouchPoints(const QTouchEvent::TouchPoint &lhs, const QTouchEvent::TouchPoint &rhs) +{ + // TouchPointPressed < TouchPointMoved < TouchPointReleased + return lhs.state() < rhs.state(); +} + class MotionEventQt : public ui::MotionEvent { public: MotionEventQt(const QList<QTouchEvent::TouchPoint> &touchPoints, const base::TimeTicks &eventTime, Action action, int index = -1) @@ -983,6 +989,10 @@ void RenderWidgetHostViewQt::handleTouchEvent(QTouchEvent *ev) if (ev->type() == QEvent::TouchBegin) m_sendMotionActionDown = true; + // Make sure that ACTION_POINTER_DOWN is delivered before ACTION_MOVE, + // and ACTION_MOVE before ACTION_POINTER_UP. + std::sort(touchPoints.begin(), touchPoints.end(), compareTouchPoints); + for (int i = 0; i < touchPoints.size(); ++i) { ui::MotionEvent::Action action; switch (touchPoints[i].state()) { |