diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-06-14 16:19:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-06-14 15:01:59 +0000 |
commit | 818a2ce5dc773db55938968d5f6e7a2fd758f68a (patch) | |
tree | a2e6e0a4ae7307962ba7860091cc6a75a85e0caf /src | |
parent | cf8bc1899abbce736a29841a10119fc0ca8b8b42 (diff) |
Fix translation of multiple pressed mouse buttons
We were reporting any mouse button event where the left mouse button was
held as a left mouse button event. We should instead separate the button
changed and the ones held.
Also adds test of the translation.
Change-Id: I1139d6615d54a036dfe843fdb1d1c90b23b467b5
Reviewed-by: Alexandru Croitor <alexandru.croitor@theqtcompany.com>
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/web_event_factory.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/web_event_factory.cpp b/src/core/web_event_factory.cpp index 2e6fde214..da230479a 100644 --- a/src/core/web_event_factory.cpp +++ b/src/core/web_event_factory.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. +** Copyright (C) 2016 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWebEngine module of the Qt Toolkit. @@ -483,11 +483,11 @@ static inline double currentTimeForEvent(const QInputEvent* event) static WebMouseEvent::Button mouseButtonForEvent(QMouseEvent *event) { - if (event->button() == Qt::LeftButton || (event->buttons() & Qt::LeftButton)) + if (event->button() == Qt::LeftButton) return WebMouseEvent::ButtonLeft; - else if (event->button() == Qt::RightButton || (event->buttons() & Qt::RightButton)) + else if (event->button() == Qt::RightButton) return WebMouseEvent::ButtonRight; - else if (event->button() == Qt::MidButton || (event->buttons() & Qt::MidButton)) + else if (event->button() == Qt::MidButton) return WebMouseEvent::ButtonMiddle; return WebMouseEvent::ButtonNone; } |