Hi,

i noticed that the mouse movement on my powermac can be pretty jittery at times.
One of the reasons I have identified is our use of a position change threshold.

The driver ignores all finger position changes below a certain threshold.
If the finger position change is > threshold it is used to calculate a new mouse
pointer position from the value of the change.
I think it would be better to use the difference of the finger position delta
minus threshold for those calculations, otherwise the minimal mouse position
change is also > threshold which seems wrong.

feedback, ok?

Index: utpms.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/utpms.c,v
retrieving revision 1.10
diff -u -p -r1.10 utpms.c
--- utpms.c     11 Sep 2020 19:18:01 -0000      1.10
+++ utpms.c     19 Oct 2020 16:55:53 -0000
@@ -638,8 +638,8 @@ detect_pos(int *sensors, int n_sensors, 
                if (sensors[i] >= threshold) {
                        if (i == 0 || sensors[i - 1] < threshold)
                                *fingers_ret += 1;
-                       s += sensors[i];
-                       w += sensors[i] * i;
+                       s += sensors[i] - threshold;
+                       w += (sensors[i] - threshold) * i;
                }
        }
 

Reply via email to