diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2014-02-26 16:24:58 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-27 13:28:31 +0100 |
commit | b3aed29c434994f2e980a8ca371ab83b48e5d98b (patch) | |
tree | 647ccd03659477dcab3fbf13d50e513534149f51 /src/plugins | |
parent | cebdd91f8bbebf43fd2ec3c4dd2f49f46172d47e (diff) |
Windows: Set source of synthesized mouse events correctly.
The source was never set for OS-synthesized events, causing duplicated
touch clicks to occur in Quick 2 applications.
Task-number: QTBUG-31386
Change-Id: Ib6d1405815dfb8e57d6446c72a7d6e2a044281ea
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsmousehandler.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/plugins/platforms/windows/qwindowsmousehandler.cpp b/src/plugins/platforms/windows/qwindowsmousehandler.cpp index d8c0a9e426..dfa400285a 100644 --- a/src/plugins/platforms/windows/qwindowsmousehandler.cpp +++ b/src/plugins/platforms/windows/qwindowsmousehandler.cpp @@ -173,15 +173,15 @@ bool QWindowsMouseHandler::translateMouseEvent(QWindow *window, HWND hwnd, // Check for events synthesized from touch. Lower byte is touch index, 0 means pen. static const bool passSynthesizedMouseEvents = !(QWindowsIntegration::instance()->options() & QWindowsIntegration::DontPassOsMouseEventsSynthesizedFromTouch); - 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 & 0x80); - if (fromTouch) - return false; + // 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(); + if ((extraInfo & signatureMask) == miWpSignature) { source = Qt::MouseEventSynthesizedBySystem; + const bool fromTouch = extraInfo & 0x80; // (else: Tablet PC) + if (fromTouch && !passSynthesizedMouseEvents) + return false; } #endif // !Q_OS_WINCE |