From 9cdd03b44a09b6b40656d4a494f58384007d8aac Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 1 Mar 2016 14:16:05 +0100 Subject: Fix crash when link opens a modal QDialog, using the trackpad. When a QWebEngine link is clicked on, and as a result a modal dialog is opened, a QEvent::TouchCancel without any touch points is forwarded to Chromium, which tries to access the first touch point position, and causes a QList assertion. Fix consists of two parts: 1) Make sure that no TouchCancel is forwarded, in case if no TouchBegin or TouchUpdate was issued beforehand. 2) Because QEvent::TouchCancel events might contain an empty touch point list, and Chromium expects at least one point, make sure to forward the last saved touch points (saved in previous TouchUpdate) together with the TouchCancel. Task-number: QTBUG-48661 Change-Id: I1eeb2980417b1b04e8387dc9f82f935ef2bd8f00 Reviewed-by: Joerg Bornemann --- src/core/render_widget_host_view_qt.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/core/render_widget_host_view_qt.h') diff --git a/src/core/render_widget_host_view_qt.h b/src/core/render_widget_host_view_qt.h index 7c4723f0e..2a56f61a4 100644 --- a/src/core/render_widget_host_view_qt.h +++ b/src/core/render_widget_host_view_qt.h @@ -205,6 +205,7 @@ public: private: void sendDelegatedFrameAck(); void processMotionEvent(const ui::MotionEvent &motionEvent); + void clearPreviousTouchMotionState(); QList mapTouchPointIds(const QList &inputPoints); float dpiScale() const; @@ -214,7 +215,9 @@ private: ui::FilteredGestureProvider m_gestureProvider; base::TimeDelta m_eventsToNowDelta; bool m_sendMotionActionDown; + bool m_touchMotionStarted; QMap m_touchIdMapping; + QList m_previousTouchPoints; scoped_ptr m_delegate; QExplicitlySharedDataPointer m_chromiumCompositorData; -- cgit v1.2.3