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

Commit f26db0d6 authored by Jeff Brown's avatar Jeff Brown
Browse files

Fix trackball down and movement bugs.

Bug: 2823788
Change-Id: Icb0c392b58f7e735614460b5eb87439cb73ac4f2
parent 9b242faf
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -650,10 +650,20 @@ void InputDispatcher::startDispatchCycleLocked(nsecs_t currentTime,
            firstMotionSample = & motionEntry->firstSample;
        }

        // Set the X and Y offset depending on the input source.
        float xOffset, yOffset;
        if (motionEntry->source & AINPUT_SOURCE_CLASS_POINTER) {
            xOffset = dispatchEntry->xOffset;
            yOffset = dispatchEntry->yOffset;
        } else {
            xOffset = 0.0f;
            yOffset = 0.0f;
        }

        // Publish the motion event and the first motion sample.
        status = connection->inputPublisher.publishMotionEvent(motionEntry->deviceId,
                motionEntry->source, action, motionEntry->edgeFlags, motionEntry->metaState,
                dispatchEntry->xOffset, dispatchEntry->yOffset,
                xOffset, yOffset,
                motionEntry->xPrecision, motionEntry->yPrecision,
                motionEntry->downTime, firstMotionSample->eventTime,
                motionEntry->pointerCount, motionEntry->pointerIds,
+4 −0
Original line number Diff line number Diff line
@@ -270,6 +270,10 @@ void InputReader::handleKey(const RawEvent* rawEvent) {
            device->trackball.accumulator.fields |=
                    InputDevice::TrackballState::Accumulator::FIELD_BTN_MOUSE;
            device->trackball.accumulator.btnMouse = down;

            // Process the trackball change now since we may not receive a sync immediately.
            onTrackballStateChanged(rawEvent->when, device);
            device->trackball.accumulator.clear();
            return;
        }
    }