summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2015-01-28 18:26:41 +0100
committerMorten Johan Sørvig <morten.sorvig@theqtcompany.com>2015-02-12 10:08:22 +0000
commit317c341a66328f1ac4fdf302b009f8bb5002799d (patch)
tree9297dae7130602842b08ffe6d177e56597836475 /src/plugins
parentcd83859bd6310a2cf0a67c489aa597dc87e326b4 (diff)
QWheelEvent on OSX: phase changes to ScrollEnd after momentum phase
The phase changes to ScrollEnd as soon as the user's fingers are lifted from the trackpad; then the OS can optionally continue sending scroll events to simulate deceleration, which are translated into more QWheelEvents with phase ScrollUpdate. With this patch, the phase of the final event after the momentum phase will be ScrollEnd to indicate that the scrolling is completely finished. [ChangeLog][QtGui][QWheelEvent] on OSX, trackpad wheel event phase transitions occur in the order ScrollBegin, ScrollUpdate, ..., ScrollEnd, ScrollUpdate, ..., ScrollEnd, where the second batch of updates represent momentum events (inertial scrolling). Change-Id: I7404ed6fbbeaff6b1fa63e226fe1800494986b7b Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index d7e1a57166..e2da8722a3 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -1326,7 +1326,8 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
if (!m_scrolling)
ph = Qt::ScrollBegin;
m_scrolling = true;
- } else if (phase == NSEventPhaseEnded || phase == NSEventPhaseCancelled) {
+ } else if (phase == NSEventPhaseEnded || phase == NSEventPhaseCancelled ||
+ momentumPhase == NSEventPhaseEnded || momentumPhase == NSEventPhaseCancelled) {
ph = Qt::ScrollEnd;
m_scrolling = false;
}