~nick-dedekind/qtubuntu/lp1596524.use-pbuffers

« back to all changes in this revision

Viewing changes to src/ubuntumirclient/input.cpp

  • Committer: Bileto Bot
  • Author(s): Daniel van Vugt
  • Date: 2016-08-09 23:00:49 UTC
  • mfrom: (331.1.1 correct-scroll-speed)
  • Revision ID: ci-train-bot@canonical.com-20160809230049-a9m7cqrsgqm8j1ka
Use correct scrolling scale of 120 as documented:
   http://doc.qt.io/qt-5/qwheelevent.html#angleDelta
because it's in eighths of a degree, and not degrees.
So now the speed is correct when used with the corresponding Unity8
fix (LP: #1607240) (LP: #1607223, #1607240)

Approved by: Lukáš Tinkl, Unity8 CI Bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
521
521
        const float vDelta = mir_pointer_event_axis_value(pev, mir_pointer_axis_vscroll);
522
522
 
523
523
        if (hDelta != 0 || vDelta != 0) {
524
 
            const QPoint angleDelta = QPoint(hDelta * 15, vDelta * 15);
 
524
            // QWheelEvent::DefaultDeltasPerStep = 120 but doesn't exist on vivid
 
525
            const QPoint angleDelta(120 * hDelta, 120 * vDelta);
525
526
            QWindowSystemInterface::handleWheelEvent(window, timestamp, localPoint, window->position() + localPoint,
526
527
                                                     QPoint(), angleDelta, modifiers, Qt::ScrollUpdate);
527
528
        }