diff options
author | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2011-01-25 09:35:13 (GMT) |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2011-01-25 09:35:13 (GMT) |
commit | aeac5bf7cebb304eaf68bd7490294fc7021fe4c4 (patch) | |
tree | 4ca83287c9f5dc69375655c081b24ae5605219cf /src/gui/kernel/qcocoaview_mac.mm | |
parent | 69f77d0cc1b6c403dff32599dd23c1714098f36a (diff) | |
download | Qt-aeac5bf7cebb304eaf68bd7490294fc7021fe4c4.zip Qt-aeac5bf7cebb304eaf68bd7490294fc7021fe4c4.tar.gz Qt-aeac5bf7cebb304eaf68bd7490294fc7021fe4c4.tar.bz2 |
Cocoa: disable scroll optimization for certain cases
No reason to use the optimization when only scrolling in one
direction. In those cases we are better off scrolling immidiatly
when requested to minimize the shuffling of
scrolls and repaints done by the application
Diffstat (limited to 'src/gui/kernel/qcocoaview_mac.mm')
-rw-r--r-- | src/gui/kernel/qcocoaview_mac.mm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index 1b81699..f0ae886 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -581,26 +581,28 @@ static int qCocoaViewCount = 0; #ifndef QT_NO_WHEELEVENT // ### Qt 5: Send one QWheelEvent with dx, dy and dz - QMacScrollOptimization::initNewScroll(); + if (deltaX != 0 && deltaY != 0) + QMacScrollOptimization::initDelayedScroll(); if (deltaX != 0) { QWheelEvent qwe(qlocal, qglobal, deltaX, buttons, keyMods, Qt::Horizontal); qt_sendSpontaneousEvent(widgetToGetMouse, &qwe); } - if (deltaY) { + if (deltaY != 0) { QWheelEvent qwe(qlocal, qglobal, deltaY, buttons, keyMods, Qt::Vertical); qt_sendSpontaneousEvent(widgetToGetMouse, &qwe); } - if (deltaZ) { + if (deltaZ != 0) { // Qt doesn't explicitly support wheels with a Z component. In a misguided attempt to // try to be ahead of the pack, I'm adding this extra value. QWheelEvent qwe(qlocal, qglobal, deltaZ, buttons, keyMods, (Qt::Orientation)3); qt_sendSpontaneousEvent(widgetToGetMouse, &qwe); } - QMacScrollOptimization::performDelayedScroll(); + if (deltaX != 0 && deltaY != 0) + QMacScrollOptimization::performDelayedScroll(); #endif //QT_NO_WHEELEVENT } |