Fix globalPos() in scrollwheel events on OSX.

The window position was getting passed as both the window
and global positions.

QTBUG-29543

Change-Id: I24746675e5ba45adbd054742877bd2fe783d6608
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
This commit is contained in:
Josh Faust 2013-02-06 15:49:02 -08:00 committed by The Qt Project
parent 733430636d
commit 02a1243dda

View File

@ -645,9 +645,8 @@ static QTouchDevice *touchDevice = 0;
}
#endif
NSPoint windowPoint = [self convertPoint: [theEvent locationInWindow] fromView: nil];
QPoint qt_windowPoint(windowPoint.x, windowPoint.y);
QPoint qt_windowPoint, qt_screenPoint;
[self convertFromEvent:theEvent toWindowPoint:&qt_windowPoint andScreenPoint:&qt_screenPoint];
NSTimeInterval timestamp = [theEvent timestamp];
ulong qt_timestamp = timestamp * 1000;
@ -665,7 +664,7 @@ static QTouchDevice *touchDevice = 0;
currentWheelModifiers = [self convertKeyModifiers:[theEvent modifierFlags]];
}
QWindowSystemInterface::handleWheelEvent(m_window, qt_timestamp, qt_windowPoint, qt_windowPoint, pixelDelta, angleDelta, currentWheelModifiers);
QWindowSystemInterface::handleWheelEvent(m_window, qt_timestamp, qt_windowPoint, qt_screenPoint, pixelDelta, angleDelta, currentWheelModifiers);
if (phase == NSEventPhaseEnded || phase == NSEventPhaseCancelled) {
currentWheelModifiers = Qt::NoModifier;
@ -673,7 +672,7 @@ static QTouchDevice *touchDevice = 0;
} else
#endif
{
QWindowSystemInterface::handleWheelEvent(m_window, qt_timestamp, qt_windowPoint, qt_windowPoint, pixelDelta, angleDelta,
QWindowSystemInterface::handleWheelEvent(m_window, qt_timestamp, qt_windowPoint, qt_screenPoint, pixelDelta, angleDelta,
[self convertKeyModifiers:[theEvent modifierFlags]]);
}
}