On 03/02/15(Tue) 22:36, Ulf Brosziewski wrote:
> On 01/30/2015 11:04 AM, Ulf Brosziewski wrote:
> >On 01/30/2015 07:15 AM, Martin Pieuchot wrote:
> >>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?
> >>
> >>>...
> >
> >Certainly that would be a better solution. For synaptics hardware there
> >seems to be no specific W value that signals the end of a touch. If I
> >understand it correctly, the hardware reports zero coordinates instead
> >and the X driver adjusts its state accordingly. I will try to check soon
> >whether this is correct and whether the ALPS code could be adapted.
> >
> >
> 
> I couldn't test it directly, but according to the "Synaptics PS/2 TouchPad
> Interfacing Guide" synaptics hardware does indeed signal a W value of 0 if
> there is no pressure as well as for two-finger contacts. This means that
> the ALPS part of pms is correct and shouldn't be changed. For a proper
> finger count Z must be checked, and the place to do this is probably in
> wsconscomm. I have changed the patch accordingly.
> 
> The change in the new version applies to all touchpad/clickpad models and
> would require appropriate testing. In my own tests with the ALPS Glidepoint
> touchpad and the Elantech Clickpad - and the patched pms version - I didn't
> observe any problems.

I'm running with this diff on a "pms0: Synaptics clickpad, firmware
8.0".  I'm seeing no problem with it, and it seems to improve the
two-finger scrolling situation where previously the cursor would go
crazy.

Since it has been tested on various Synaptics, ALPS and Elantech I think
it is safe to put it in.

Anybody wants to ok this diff?


Btw Ulf, it seems your mail client mangles tab/space.  I couldn't apply
your diff correctly :/

> diff --git a/wsconscomm.c b/wsconscomm.c
> index df3512d..70c103a 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;
> @@ -218,6 +214,10 @@ WSConsReadHwState(InputInfoPtr pInfo,
>              }
>              break;
>          case WSCONS_EVENT_SYNC:
> +            if (hw->z == 0) {
> +                hw->fingerWidth = 0;
> +                hw->numFingers = 0;
> +            }
>              hw->millis = 1000 * event.time.tv_sec + event.time.tv_nsec /
> 1000000;
>              SynapticsCopyHwState(hwRet, hw);
>              return TRUE;
> 

Reply via email to