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 <joerg.bornemann@digia.com>
This commit is contained in:
Friedemann Kleint 2013-07-02 13:30:05 +02:00 committed by The Qt Project
parent 323164f5fb
commit 671d607512

View File

@ -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;