From 14e4314b5c2cfddb1e92fa1fefeaf7bea2dd6b3a Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Mon, 8 Jun 2009 14:22:36 +0200 Subject: Fix raw translation on Windows We don't keep the state from the previous events anymore, so the 'down' variable is useless (and actually caused problems). --- src/gui/kernel/qapplication_win.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index 4bbec96..8145702 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -4022,28 +4022,26 @@ bool QApplicationPrivate::translateTouchEvent(const MSG &msg) QTouchEvent::TouchPoint touchPoint(touchPointID); // update state - bool down = touchPoint.state() != Qt::TouchPointReleased; QPointF globalPos(qreal(touchInput.x) / qreal(100.), qreal(touchInput.y) / qreal(100.)); QSizeF contactArea = (touchInput.dwMask & TOUCHINPUTMASKF_CONTACTAREA) ? QSizeF(qreal(touchInput.cxContact) / qreal(100.), qreal(touchInput.cyContact) / qreal(100.)) : QSizeF(); - if (!down && (touchInput.dwFlags & TOUCHEVENTF_DOWN)) { + if (touchInput.dwFlags & TOUCHEVENTF_DOWN) { touchPoint.setState(Qt::TouchPointPressed); touchPoint.setGlobalPos(globalPos); touchPoint.setSize(contactArea); - } else if (down && (touchInput.dwFlags & TOUCHEVENTF_UP)) { + } else if (touchInput.dwFlags & TOUCHEVENTF_UP) { touchPoint.setState(Qt::TouchPointReleased); touchPoint.setGlobalPos(globalPos); touchPoint.setSize(QSizeF()); - } else if (down) { + } else { touchPoint.setState(globalPos == touchPoint.globalPos() ? Qt::TouchPointStationary : Qt::TouchPointMoved); touchPoint.setGlobalPos(globalPos); touchPoint.setSize(contactArea); - // pressure should still be 1. } touchPoints.append(touchPoint); -- cgit v0.12