On Fri, 29 Jun 2012 16:11:47 +0200, Martin Pieuchot wrote:
Here's a fix that makes ALPS touchpads work with the latest versions of
xf86-input-synaptics.

The problem is that the pms(4) driver doesn't send a finger width value (because none are reported) leaving the number of pressing fingers to 0.
And since the xf86-input-synaptics commit 3822705, if the number of
pressing fingers is different than 0 the packet counter is reset leading
to an always-0 packet count.

This diff generate a width value corresponding to one finger when
the pressure value is non-null, fixing the above mentioned problem.

Ok?

Martin

Index: pms.c
===================================================================
RCS file: /cvs/src/sys/dev/pckbc/pms.c,v
retrieving revision 1.29
diff -u -p -r1.29 pms.c
--- pms.c       28 Apr 2012 09:43:24 -0000      1.29
+++ pms.c       29 Jun 2012 13:31:13 -0000
@@ -1281,7 +1281,7 @@ void
 pms_proc_alps(struct pms_softc *sc)
 {
        struct alps_softc *alps = sc->alps;
-       int x, y, z, dx, dy;
+       int x, y, z, w, dx, dy;
        u_int buttons;
        int fin, ges;

@@ -1329,9 +1329,13 @@ pms_proc_alps(struct pms_softc *sc)
                if (ges && fin && !alps->old_fin)
                        z = 0;

-               wsmouse_input(sc->sc_wsmousedev, buttons, x, y, z, 0,
+               /* Generate a width value corresponding to one finger */
+               if (z > 0)
+                       w = 4;
+
+               wsmouse_input(sc->sc_wsmousedev, buttons, x, y, z, w,
                    WSMOUSE_INPUT_ABSOLUTE_X | WSMOUSE_INPUT_ABSOLUTE_Y |
-                   WSMOUSE_INPUT_ABSOLUTE_Z);
+                   WSMOUSE_INPUT_ABSOLUTE_Z | WSMOUSE_INPUT_ABSOLUTE_W);

                alps->old_fin = fin;
        } else {

Big thanks to all of you. This works for me too.

Reply via email to