From c6964dd28a114e23de21f91c0323ae4f03fb0f16 Mon Sep 17 00:00:00 2001 From: Bartosz Brachaczek Date: Fri, 13 Nov 2009 00:18:00 +1000 Subject: Set all valuators for relative motion events (#24737) We should process all the deltas reported by a relative motion device, otherwise some devices such as A4Tech X-750F or similar may trigger a situation when the `v` array contains random values (it isn't initialized anywhere) and later we process them and in effect the mouse cursor "jumps" on the screen. I'm not sure why, but we also must be sure that the `first` and `last` variables reflect the axis map, otherwise the mouse cursor "jumps" on the screen when clicking mouse buttons in some rare cases reported by Bartek Iwaniec on Bugzilla. That's why a simple initialization of the `v` array with zeros isn't sufficient. X.Org Bug 24737 Signed-off-by: Bartosz Brachaczek Signed-off-by: Peter Hutterer (cherry picked from commit c1f16a4f59a584ab4546c2f16e20b06703042057) --- src/evdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/evdev.c b/src/evdev.c index 894aca4..33e02ab 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -440,7 +440,7 @@ EvdevProcessValuators(InputInfoPtr pInfo, int v[MAX_VALUATORS], int *num_v, for (i = 0; i < REL_CNT; i++) { int map = pEvdev->axis_map[i]; - if (pEvdev->delta[i] && map != -1) + if (map != -1) { v[map] = pEvdev->delta[i]; if (map < first) -- cgit v1.2.3