From 671d6075127bf7cb2d6c1c7ae539c266a320604e Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 2 Jul 2013 13:30:05 +0200 Subject: Windows: Fix detection of synthesized mouse events for MSVC / 64bit. For some reason, the enumeration values were signed when using 64bit. Task-number: QTBUG-31386 Change-Id: I891dbe1a82dc2aefbe13a131c72c01a57f981767 Reviewed-by: Joerg Bornemann --- src/plugins/platforms/windows/qwindowsmousehandler.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowsmousehandler.cpp b/src/plugins/platforms/windows/qwindowsmousehandler.cpp index c6cfa4dbbc..43286eadf3 100644 --- a/src/plugins/platforms/windows/qwindowsmousehandler.cpp +++ b/src/plugins/platforms/windows/qwindowsmousehandler.cpp @@ -157,14 +157,19 @@ bool QWindowsMouseHandler::translateMouseEvent(QWindow *window, HWND hwnd, QtWindows::WindowsEventType et, MSG msg, LRESULT *result) { - enum { signatureMask = 0xffffff00, miWpSignature = 0xff515700 }; +#ifdef Q_COMPILER_CLASS_ENUM + enum : quint64 { signatureMask = 0xffffff00, miWpSignature = 0xff515700 }; +#else + static const quint64 signatureMask = 0xffffff00; + static const quint64 miWpSignature = 0xff515700; +#endif // !Q_COMPILER_CLASS_ENUM if (et == QtWindows::MouseWheelEvent) return translateMouseWheelEvent(window, hwnd, msg, result); #ifndef Q_OS_WINCE // Check for events synthesized from touch. Lower byte is touch index, 0 means pen. - const LPARAM extraInfo = GetMessageExtraInfo(); + const quint64 extraInfo = GetMessageExtraInfo(); const bool fromTouch = (extraInfo & signatureMask) == miWpSignature && (extraInfo & 0xff); if (fromTouch) return false; -- cgit v1.2.3