summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@digia.com>2013-08-13 09:54:40 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-15 08:57:01 +0200
commitbab29dd76c7b6794e683220c918dca7c3f5a89fd (patch)
treefca59c0b3a2862ffe5331f589dd3315fcca8dbf6 /src/plugins/platforms/cocoa
parent37215efeea7a255e6a0d72bd8f39d476735cc94a (diff)
Cocoa: bugfix mouse wheel + modifier keys not working
To avoid using modifier keys when releasing a two-finger mouse wheel flick on a trackpad, we listen to event phases. But for a normal mouse, a separate phase NSEventPhaseNone is given. Ensure that we still send modifier keys when that state is reported. Task-number: QTBUG-32098 Change-Id: Ib840dd661b7842ae49127e5a8d42e3666ae2da4e Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index 4ffab289f0..a949bb3ea5 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -872,13 +872,13 @@ static QTouchDevice *touchDevice = 0;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
if ([theEvent respondsToSelector:@selector(scrollingDeltaX)]) {
NSEventPhase phase = [theEvent phase];
- if (phase == NSEventPhaseBegan) {
+ if (phase == NSEventPhaseBegan || phase == NSEventPhaseNone) {
currentWheelModifiers = [QNSView convertKeyModifiers:[theEvent modifierFlags]];
}
QWindowSystemInterface::handleWheelEvent(m_window, qt_timestamp, qt_windowPoint, qt_screenPoint, pixelDelta, angleDelta, currentWheelModifiers);
- if (phase == NSEventPhaseEnded || phase == NSEventPhaseCancelled) {
+ if (phase == NSEventPhaseEnded || phase == NSEventPhaseCancelled || phase == NSEventPhaseNone) {
currentWheelModifiers = Qt::NoModifier;
}
} else