From 134b8e304f376e38d25f4d34de73e44fb31b2a70 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 14 Jun 2016 16:27:03 +0200 Subject: Do not forward invalid mouse events to blink MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Blink can not handle more than the three main mouse-buttons, and we were translating a press of an extra mouse-button as a mouse-down of the button ButtonNone. Instead ignore mouse-button events blink does not currently support. Task-number: QTBUG-53799 Change-Id: If1d3ba6bd331ec8ad0ff45bcd674e67763ee9097 Reviewed-by: Michael BrĂ¼ning --- src/core/render_widget_host_view_qt.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index 5183f6732..c088b09e9 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -886,6 +886,13 @@ void RenderWidgetHostViewQt::handleMouseEvent(QMouseEvent* event) return; blink::WebMouseEvent webEvent = WebEventFactory::toWebMouseEvent(event, dpiScale()); + if ((webEvent.type == blink::WebInputEvent::MouseDown || webEvent.type == blink::WebInputEvent::MouseUp) + && webEvent.button == blink::WebMouseEvent::ButtonNone) { + // Blink can only handle the 3 main mouse-buttons and may assert when processing mouse-down for no button. + return; + } + + if (event->type() == QMouseEvent::MouseButtonPress) { if (event->button() != m_clickHelper.lastPressButton || (event->timestamp() - m_clickHelper.lastPressTimestamp > static_cast(qGuiApp->styleHints()->mouseDoubleClickInterval())) -- cgit v1.2.3