diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2013-09-26 15:55:03 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-26 18:45:16 +0200 |
commit | 279db88c39ae51db2cde80559e30e52457536d12 (patch) | |
tree | 7646e0840863832f3056e56f73ac9c97a91138b5 /src/plugins/platforms/windows | |
parent | 9bf820ce4769a873a38bf97678d717bf82c4a285 (diff) |
Correct the detection of Windows-generated mouse events
Check only bit 8 to decide if the mouse event is generated from
a touch or pen event.
Task-number: QTBUG-33460
Change-Id: I83b23267b5de6df5e0e6b7113ecf377dd7e86c84
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/plugins/platforms/windows')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsmousehandler.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/qwindowsmousehandler.cpp b/src/plugins/platforms/windows/qwindowsmousehandler.cpp index 3782b7e020..3dd8c5a0cd 100644 --- a/src/plugins/platforms/windows/qwindowsmousehandler.cpp +++ b/src/plugins/platforms/windows/qwindowsmousehandler.cpp @@ -168,11 +168,13 @@ bool QWindowsMouseHandler::translateMouseEvent(QWindow *window, HWND hwnd, return translateMouseWheelEvent(window, hwnd, msg, result); #ifndef Q_OS_WINCE - // Check for events synthesized from touch. Lower byte is touch index, 0 means pen. static const bool passSynthesizedMouseEvents = QWindowsIntegration::instance()->options() & QWindowsIntegration::PassOsMouseEventsSynthesizedFromTouch; if (!passSynthesizedMouseEvents) { + // Check for events synthesized from touch. Lower 7 bits are touch/pen index, bit 8 indicates touch. + // However, when tablet support is active, extraInfo is a packet serial number. This is not a problem + // since we do not want to ignore mouse events coming from a tablet. const quint64 extraInfo = GetMessageExtraInfo(); - const bool fromTouch = (extraInfo & signatureMask) == miWpSignature && (extraInfo & 0xff); + const bool fromTouch = (extraInfo & signatureMask) == miWpSignature && (extraInfo & 0x80); if (fromTouch) return false; } |