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:
parent
733430636d
commit
02a1243dda
@ -645,9 +645,8 @@ static QTouchDevice *touchDevice = 0;
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
QPoint qt_windowPoint, qt_screenPoint;
|
||||||
NSPoint windowPoint = [self convertPoint: [theEvent locationInWindow] fromView: nil];
|
[self convertFromEvent:theEvent toWindowPoint:&qt_windowPoint andScreenPoint:&qt_screenPoint];
|
||||||
QPoint qt_windowPoint(windowPoint.x, windowPoint.y);
|
|
||||||
NSTimeInterval timestamp = [theEvent timestamp];
|
NSTimeInterval timestamp = [theEvent timestamp];
|
||||||
ulong qt_timestamp = timestamp * 1000;
|
ulong qt_timestamp = timestamp * 1000;
|
||||||
|
|
||||||
@ -665,7 +664,7 @@ static QTouchDevice *touchDevice = 0;
|
|||||||
currentWheelModifiers = [self convertKeyModifiers:[theEvent modifierFlags]];
|
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) {
|
if (phase == NSEventPhaseEnded || phase == NSEventPhaseCancelled) {
|
||||||
currentWheelModifiers = Qt::NoModifier;
|
currentWheelModifiers = Qt::NoModifier;
|
||||||
@ -673,7 +672,7 @@ static QTouchDevice *touchDevice = 0;
|
|||||||
} else
|
} else
|
||||||
#endif
|
#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]]);
|
[self convertKeyModifiers:[theEvent modifierFlags]]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user