diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-10-31 12:43:32 (GMT) |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2014-11-04 15:26:19 (GMT) |
commit | 1a57e3eec9dc0fe6381d3e5bf161df150fe3e115 (patch) | |
tree | 3a2326ceb5d5113f69bca94b95f06e279f342dd4 | |
parent | e93db692f88ad788a89a229ca974d5598dc104c2 (diff) | |
download | Qt-1a57e3eec9dc0fe6381d3e5bf161df150fe3e115.zip Qt-1a57e3eec9dc0fe6381d3e5bf161df150fe3e115.tar.gz Qt-1a57e3eec9dc0fe6381d3e5bf161df150fe3e115.tar.bz2 |
Parse multiple buttons during mouse press and release
Copies the logic for parsing mouse buttons from Qt5 QtWebKit so that
button clicks when another button is held works.
Task-number: QTBUG-42319
Change-Id: If56e20533531fe949eef444eb7e2f747907f5bcc
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
-rw-r--r-- | src/3rdparty/webkit/Source/WebCore/platform/qt/PlatformMouseEventQt.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/3rdparty/webkit/Source/WebCore/platform/qt/PlatformMouseEventQt.cpp b/src/3rdparty/webkit/Source/WebCore/platform/qt/PlatformMouseEventQt.cpp index 125ae52..0cc95cd 100644 --- a/src/3rdparty/webkit/Source/WebCore/platform/qt/PlatformMouseEventQt.cpp +++ b/src/3rdparty/webkit/Source/WebCore/platform/qt/PlatformMouseEventQt.cpp @@ -109,12 +109,14 @@ PlatformMouseEvent::PlatformMouseEvent(QInputEvent* event, int clickCount) if (me) { m_position = IntPoint(me->pos()); m_globalPosition = IntPoint(me->globalPos()); + const Qt::MouseButtons mouseButtons = (m_eventType == MouseEventMoved) ? me->buttons() : me->button(); - if (me->button() == Qt::LeftButton || (me->buttons() & Qt::LeftButton)) + + if (mouseButtons & Qt::LeftButton) m_button = LeftButton; - else if (me->button() == Qt::RightButton || (me->buttons() & Qt::RightButton)) + else if (mouseButtons & Qt::RightButton) m_button = RightButton; - else if (me->button() == Qt::MidButton || (me->buttons() & Qt::MidButton)) + else if (mouseButtons & Qt::MidButton) m_button = MiddleButton; else m_button = NoButton; |