Now in clickpad mode the pointer moves to [1,1] (upper left corner)
even on a single tap. These patches fixes it.

On issue pointed gilles@ and matthieu@

* cd /sys
* patch < 01_kernel.diff
* build and install new kernel
* cd /usr/src
* (if need - make obj)
* make includes
* cd /usr/xenocara/driver/xf86-input-synaptics
* patch < 02_xenocara.diff
* make -f Makefile.bsd-wrapper obj build
* reboot and test

Also need check on other touchpad.

Comments ? OK ?

-- 
Alexandr Shadchin
Index: dev/pckbc/pms.c
===================================================================
RCS file: /cvs/src/sys/dev/pckbc/pms.c,v
retrieving revision 1.30
diff -u -p -r1.30 pms.c
--- dev/pckbc/pms.c     1 Jul 2012 12:59:34 -0000       1.30
+++ dev/pckbc/pms.c     10 Jul 2012 18:17:14 -0000
@@ -782,6 +782,9 @@ int
 synaptics_get_hwinfo(struct pms_softc *sc)
 {
        struct synaptics_softc *syn = sc->synaptics;
+#ifdef DEBUG
+       int i, val;
+#endif
 
        if (synaptics_query(sc, SYNAPTICS_QUE_IDENTIFY, &syn->identify))
                return (-1);
@@ -817,6 +820,15 @@ synaptics_get_hwinfo(struct pms_softc *s
        if (SYNAPTICS_EXT_MODEL_BUTTONS(syn->ext_model) > 8)
                syn->ext_model &= ~0xf000;
 
+#ifdef DEBUG
+       for (i = 0; i < 16; i++) {
+               if (synaptics_query(sc, i, &val))
+                       printf("%s: querie %2d: fail\n", DEVNAME(sc), i);
+               else
+                       printf("%s: querie %2d: 0x%06x\n", DEVNAME(sc), i, val);
+       }
+#endif
+
        return (0);
 }
 
@@ -1026,7 +1038,8 @@ pms_proc_synaptics(struct pms_softc *sc)
        if (syn->wsmode == WSMOUSE_NATIVE) {
                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_W);
+                   WSMOUSE_INPUT_ABSOLUTE_Z | WSMOUSE_INPUT_ABSOLUTE_W |
+                   WSMOUSE_INPUT_SYNC);
        } else {
                dx = dy = 0;
                if (z > SYNAPTICS_PRESSURE) {
@@ -1335,7 +1348,8 @@ pms_proc_alps(struct pms_softc *sc)
 
                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_W);
+                   WSMOUSE_INPUT_ABSOLUTE_Z | WSMOUSE_INPUT_ABSOLUTE_W |
+                   WSMOUSE_INPUT_SYNC);
 
                alps->old_fin = fin;
        } else {
Index: dev/wscons/wsconsio.h
===================================================================
RCS file: /cvs/src/sys/dev/wscons/wsconsio.h,v
retrieving revision 1.65
diff -u -p -r1.65 wsconsio.h
--- dev/wscons/wsconsio.h       17 Apr 2012 08:51:24 -0000      1.65
+++ dev/wscons/wsconsio.h       10 Jul 2012 18:17:14 -0000
@@ -80,6 +80,7 @@ struct wscons_event {
                                     /* 12-15, see below */
 #define        WSCONS_EVENT_MOUSE_DELTA_W      16      /* W delta amount */
 #define        WSCONS_EVENT_MOUSE_ABSOLUTE_W   17      /* W location */
+#define        WSCONS_EVENT_SYNC               18
 /* 
  * Following events are not real wscons_event but are used as parameters of the
  * WSDISPLAYIO_WSMOUSED ioctl 
Index: dev/wscons/wsmouse.c
===================================================================
RCS file: /cvs/src/sys/dev/wscons/wsmouse.c,v
retrieving revision 1.22
diff -u -p -r1.22 wsmouse.c
--- dev/wscons/wsmouse.c        17 Aug 2011 16:10:27 -0000      1.22
+++ dev/wscons/wsmouse.c        10 Jul 2012 18:17:14 -0000
@@ -455,6 +455,14 @@ wsmouse_input(struct device *wsmousedev,
                ub ^= d;
        }
 
+       if (flags & WSMOUSE_INPUT_SYNC) {
+               NEXT;
+               ev->type = WSCONS_EVENT_SYNC;
+               ev->value = 0;
+               TIMESTAMP;
+               ADVANCE;
+       }
+
        /* XXX fake wscons_event notifying wsmoused(8) to close mouse device */
        if (flags & WSMOUSE_INPUT_WSMOUSED_CLOSE) {
                NEXT;
Index: dev/wscons/wsmousevar.h
===================================================================
RCS file: /cvs/src/sys/dev/wscons/wsmousevar.h,v
retrieving revision 1.5
diff -u -p -r1.5 wsmousevar.h
--- dev/wscons/wsmousevar.h     10 Apr 2007 22:37:17 -0000      1.5
+++ dev/wscons/wsmousevar.h     10 Jul 2012 18:17:14 -0000
@@ -72,6 +72,7 @@ int   wsmousedevprint(void *, const char *
 #define WSMOUSE_INPUT_ABSOLUTE_Y       (1<<1)
 #define WSMOUSE_INPUT_ABSOLUTE_Z       (1<<2)
 #define WSMOUSE_INPUT_ABSOLUTE_W       (1<<4)
+#define WSMOUSE_INPUT_SYNC             (1<<5)
 #define WSMOUSE_INPUT_WSMOUSED_CLOSE   (1<<3) /* notify wsmoused(8) to close
                                                  mouse device */
Index: src/wsconscomm.c
===================================================================
RCS file: /cvs/xenocara/driver/xf86-input-synaptics/src/wsconscomm.c,v
retrieving revision 1.5
diff -u -p -r1.5 wsconscomm.c
--- src/wsconscomm.c    12 Jun 2012 18:59:42 -0000      1.5
+++ src/wsconscomm.c    10 Jul 2012 18:16:24 -0000
@@ -131,88 +131,94 @@ WSConsReadHwState(InputInfoPtr pInfo,
     struct wscons_event event;
     Bool v;
 
-    if (WSConsReadEvent(pInfo, &event) == FALSE)
-        return FALSE;
+    /* Reset cumulative values if buttons were not previously pressed */
+    if (!hw->left && !hw->right && !hw->middle) {
+        hw->cumulative_dx = hw->x;
+        hw->cumulative_dy = hw->y;
+    }
 
-    switch (event.type) {
-    case WSCONS_EVENT_MOUSE_UP:
-    case WSCONS_EVENT_MOUSE_DOWN:
-        v = (event.type == WSCONS_EVENT_MOUSE_DOWN) ? TRUE : FALSE;
-        switch (event.value) {
-        case 0:
-            hw->left = v;
-            break;
-        case 1:
-            hw->middle = v;
-            break;
-        case 2:
-            hw->right = v;
-            break;
-        case 3:
-            hw->up = v;
-            break;
-        case 4:
-            hw->down = v;
-            break;
-        case 5:
-            hw->multi[0] = v;
-            break;
-        case 6:
-            hw->multi[1] = v;
-            break;
-        case 7:
-            hw->multi[2] = v;
-            break;
-        case 8:
-            hw->multi[3] = v;
-            break;
-        case 9:
-            hw->multi[4] = v;
-            break;
-        case 10:
-            hw->multi[5] = v;
-            break;
-        case 11:
-            hw->multi[6] = v;
-            break;
-        case 12:
-            hw->multi[7] = v;
-            break;
+    while (WSConsReadEvent(pInfo, &event)) {
+        switch (event.type) {
+        case WSCONS_EVENT_MOUSE_UP:
+        case WSCONS_EVENT_MOUSE_DOWN:
+            v = (event.type == WSCONS_EVENT_MOUSE_DOWN) ? TRUE : FALSE;
+            switch (event.value) {
+            case 0:
+                hw->left = v;
+                break;
+            case 1:
+                hw->middle = v;
+                break;
+            case 2:
+                hw->right = v;
+                break;
+            case 3:
+                hw->up = v;
+                break;
+            case 4:
+                hw->down = v;
+                break;
+            case 5:
+                hw->multi[0] = v;
+                break;
+            case 6:
+                hw->multi[1] = v;
+                break;
+            case 7:
+                hw->multi[2] = v;
+                break;
+            case 8:
+                hw->multi[3] = v;
+                break;
+            case 9:
+                hw->multi[4] = v;
+                break;
+            case 10:
+                hw->multi[5] = v;
+                break;
+            case 11:
+                hw->multi[6] = v;
+                break;
+            case 12:
+                hw->multi[7] = v;
+                break;
+            }
+            break;
+        case WSCONS_EVENT_MOUSE_ABSOLUTE_X:
+            hw->x = event.value;
+            break;
+        case WSCONS_EVENT_MOUSE_ABSOLUTE_Y:
+            hw->y = priv->maxy - event.value + priv->miny;
+            break;
+        case WSCONS_EVENT_MOUSE_ABSOLUTE_Z:
+            hw->z = event.value;
+            break;
+        case WSCONS_EVENT_MOUSE_ABSOLUTE_W:
+            switch (event.value) {
+            case 0:
+                hw->fingerWidth = 5;
+                hw->numFingers = 2;
+                break;
+            case 1:
+                hw->fingerWidth = 5;
+                hw->numFingers = 3;
+                break;
+            case 4 ... 5:
+                hw->fingerWidth = event.value;
+                hw->numFingers = 1;
+                break;
+            }
+            break;
+        case WSCONS_EVENT_SYNC:
+            hw->millis = 1000 * event.time.tv_sec + event.time.tv_nsec / 
1000000;
+            SynapticsCopyHwState(hwRet, hw);
+            return TRUE;
+        default:
+            return FALSE;
         }
-        break;
-    case WSCONS_EVENT_MOUSE_ABSOLUTE_X:
-        hw->x = event.value;
-        break;
-    case WSCONS_EVENT_MOUSE_ABSOLUTE_Y:
-        hw->y = priv->maxy - event.value + priv->miny;
-        break;
-    case WSCONS_EVENT_MOUSE_ABSOLUTE_Z:
-        hw->z = event.value;
-        break;
-    case WSCONS_EVENT_MOUSE_ABSOLUTE_W:
-        switch (event.value) {
-        case 0:
-            hw->fingerWidth = 5;
-            hw->numFingers = 2;
-            break;
-        case 1:
-            hw->fingerWidth = 5;
-            hw->numFingers = 3;
-            break;
-        case 4 ... 5:
-            hw->fingerWidth = event.value;
-            hw->numFingers = 1;
-            break;
-        }
-        break;
-    default:
-        return FALSE;
     }
 
-    hw->millis = GetTimeInMillis();
-
-    SynapticsCopyHwState(hwRet, hw);
-    return TRUE;
+    return FALSE;
 }
 
 static Bool

Reply via email to