diff options
author | Andras Becsi <andras.becsi@theqtcompany.com> | 2014-12-01 13:24:25 +0100 |
---|---|---|
committer | Andras Becsi <andras.becsi@theqtcompany.com> | 2014-12-01 14:28:00 +0100 |
commit | 9316b8c27c4d63ee755517fb4670268424200b3c (patch) | |
tree | a9818fd5a8798ec56add7cd622fb13cee525557a /src/core/render_widget_host_view_qt.cpp | |
parent | ad46ffd2e74b17cd7e7b8a7d73590696cc8febce (diff) | |
parent | 03a52863226aeb774721db610ba831808b30836a (diff) |
Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
src/core/access_token_store_qt.cpp
src/core/access_token_store_qt.h
src/core/content_browser_client_qt.cpp
Change-Id: Id319ad0d87ce071e63d9c6c22b4fc35523ddfa74
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 99c954595..fec9caabc 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()) { |