On 30/01/15(Fri) 01:25, Ulf Brosziewski wrote:
> Probably I was too sceptical about synaptics.c. The bug I observed
> with the ALPS touchpad seems to be due to a kind of mismatch between
> the ALPS code in pms and the event handling in wsconscomm. The patch
> below contains the initial change as well as what was necessary to
> fix this.

Do you think it is possible to fix the pms(4) driver instead of adding
another quirk?

> 
> diff --git a/wsconscomm.c b/wsconscomm.c
> index df3512d..9c5afe7 100644
> --- a/wsconscomm.c
> +++ b/wsconscomm.c
> @@ -132,12 +132,6 @@ WSConsReadHwState(InputInfoPtr pInfo,
>      struct wscons_event event;
>      Bool v;
> 
> -    /* 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;
> -    }
> -
>      while (WSConsReadEvent(pInfo, &event)) {
>          switch (event.type) {
>          case WSCONS_EVENT_MOUSE_UP:
> @@ -187,9 +181,11 @@ WSConsReadHwState(InputInfoPtr pInfo,
>              break;
>          case WSCONS_EVENT_MOUSE_ABSOLUTE_X:
>              hw->x = event.value;
> +            hw->cumulative_dx = hw->x;
>              break;
>          case WSCONS_EVENT_MOUSE_ABSOLUTE_Y:
>              hw->y = priv->maxy - event.value + priv->miny;
> +            hw->cumulative_dy = hw->y;
>              break;
>          case WSCONS_EVENT_MOUSE_ABSOLUTE_Z:
>              hw->z = event.value;
> @@ -204,8 +200,14 @@ WSConsReadHwState(InputInfoPtr pInfo,
>              /* XXX magic number mapping which is mirrored in pms driver */
>              switch (event.value) {
>              case 0:
> -                hw->fingerWidth = 5;
> -                hw->numFingers = 2;
> +                if (priv->model != MODEL_ALPS) {
> +                    hw->fingerWidth = 5;
> +                    hw->numFingers = 2;
> +                } else {
> +                    /* For ALPS models pms reports that w is 0 if (z <= 0)? 
> */
> +                    hw->fingerWidth = 0;
> +                    hw->numFingers = 0;
> +                }
>                  break;
>              case 1:
>                  hw->fingerWidth = 5;
> 

Reply via email to