input mouse: Only save last valid processed movements
Only store the last valid touchpad movement checking status result.
Prevously, invalid data provided by drivers and wrongly processed by
userspace movement maker functionality such are uninitilised or other
kind of garbage data could end up being stored as legit resulting on
many unintended misbehaviours.
Change-Id: If5888341d53405810bc7295d4fffa1f00c9482fe
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9904
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: nephele nephele <nep-git@packageloss.eu>
Diff
src/add-ons/input_server/devices/mouse/MouseInputDevice.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
@@ -450,9 +450,10 @@
}
if (read.event == MS_READ_TOUCHPAD) {
lastTouchpadMovement = read.u.touchpad;
status = fTouchpadMovementMaker.EventToMovement(&read.u.touchpad,
&movements, touchpadEventTimeout);
if (status == B_OK)
lastTouchpadMovement = read.u.touchpad;
} else if (read.event == MS_READ) {
movements = read.u.mouse;
touchpadEventTimeout = -1;