am d3616592: Fix trackball down and movement bugs.
Merge commit 'd3616592fe1b315b589766c4b74ce728fc4968f5' into gingerbread-plus-aosp * commit 'd3616592fe1b315b589766c4b74ce728fc4968f5': Fix trackball down and movement bugs.
This commit is contained in:
@@ -650,10 +650,20 @@ void InputDispatcher::startDispatchCycleLocked(nsecs_t currentTime,
|
|||||||
firstMotionSample = & motionEntry->firstSample;
|
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.
|
// Publish the motion event and the first motion sample.
|
||||||
status = connection->inputPublisher.publishMotionEvent(motionEntry->deviceId,
|
status = connection->inputPublisher.publishMotionEvent(motionEntry->deviceId,
|
||||||
motionEntry->source, action, motionEntry->edgeFlags, motionEntry->metaState,
|
motionEntry->source, action, motionEntry->edgeFlags, motionEntry->metaState,
|
||||||
dispatchEntry->xOffset, dispatchEntry->yOffset,
|
xOffset, yOffset,
|
||||||
motionEntry->xPrecision, motionEntry->yPrecision,
|
motionEntry->xPrecision, motionEntry->yPrecision,
|
||||||
motionEntry->downTime, firstMotionSample->eventTime,
|
motionEntry->downTime, firstMotionSample->eventTime,
|
||||||
motionEntry->pointerCount, motionEntry->pointerIds,
|
motionEntry->pointerCount, motionEntry->pointerIds,
|
||||||
|
|||||||
@@ -270,6 +270,10 @@ void InputReader::handleKey(const RawEvent* rawEvent) {
|
|||||||
device->trackball.accumulator.fields |=
|
device->trackball.accumulator.fields |=
|
||||||
InputDevice::TrackballState::Accumulator::FIELD_BTN_MOUSE;
|
InputDevice::TrackballState::Accumulator::FIELD_BTN_MOUSE;
|
||||||
device->trackball.accumulator.btnMouse = down;
|
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;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user