summaryrefslogtreecommitdiffstats
path: root/src/core/render_widget_host_view_qt.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-06-14 16:27:03 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2016-06-15 13:01:01 +0000
commit134b8e304f376e38d25f4d34de73e44fb31b2a70 (patch)
treeeb2b3e32704cdc29f501a9d92bad7e928fdf3468 /src/core/render_widget_host_view_qt.cpp
parent60d790a2da2f85c1a5eaca4a51a743147e5694e7 (diff)
Do not forward invalid mouse events to blink
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 <michael.bruning@qt.io>
Diffstat (limited to 'src/core/render_widget_host_view_qt.cpp')
-rw-r--r--src/core/render_widget_host_view_qt.cpp7
1 files changed, 7 insertions, 0 deletions
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<ulong>(qGuiApp->styleHints()->mouseDoubleClickInterval()))