Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ae474440 authored by Prabir Pradhan's avatar Prabir Pradhan
Browse files

CursorInputMapper: Use flat velocity params when acceleration is disabled

We still use velocity control params when the
enable_new_mouse_pointer_ballistics flag is disabled. For the old
pipeline, ensure we use flat velocity control params whenever
pointer acceleration is disabled for the associated display.

Bug: 323409820
Test: atest VirtualMouseTest#sendRelativeEvent --rerun-until-failure 100
Change-Id: Id411ee61809cb0a46413d109c03358be5457a8a6
parent 02c97164
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -164,8 +164,9 @@ std::list<NotifyArgs> CursorInputMapper::reconfigure(nsecs_t when,
        configureOnChangeDisplayInfo(readerConfig);
    }

    // Pointer speed settings depend on display settings.
    if (!changes.any() || changes.test(InputReaderConfiguration::Change::POINTER_SPEED) ||
        configurePointerCapture) {
        changes.test(InputReaderConfiguration::Change::DISPLAY_INFO) || configurePointerCapture) {
        configureOnChangePointerSpeed(readerConfig);
    }
    return out;
@@ -515,7 +516,11 @@ void CursorInputMapper::configureOnChangePointerSpeed(const InputReaderConfigura
            mNewPointerVelocityControl.setCurve(
                    createAccelerationCurveForPointerSensitivity(config.mousePointerSpeed));
        } else {
            mOldPointerVelocityControl.setParameters(config.pointerVelocityControlParameters);
            mOldPointerVelocityControl.setParameters(
                    (config.displaysWithMousePointerAccelerationDisabled.count(
                             mDisplayId.value_or(ADISPLAY_ID_NONE)) == 0)
                            ? config.pointerVelocityControlParameters
                            : FLAT_VELOCITY_CONTROL_PARAMS);
        }
        mWheelXVelocityControl.setParameters(config.wheelVelocityControlParameters);
        mWheelYVelocityControl.setParameters(config.wheelVelocityControlParameters);