[PATCH synaptics] Reset touch state on DeviceOff

Chase Douglas chase.douglas at canonical.com
Tue Apr 24 11:40:47 PDT 2012


On 04/23/2012 10:46 PM, Peter Hutterer wrote:
> Don't leave touches lingering around during suspend.
> 
> Test case:
> 1) leave finger on touchpad
> 2) xinput set-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 0
> 3) lift fingers
> 4) xinput set-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 1
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=814972
> 
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> ---
>  src/eventcomm.c |    1 +
>  src/synaptics.c |    1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/src/eventcomm.c b/src/eventcomm.c
> index 9d1233c..5707e38 100644
> --- a/src/eventcomm.c
> +++ b/src/eventcomm.c
> @@ -128,6 +128,7 @@ UninitializeTouch(InputInfoPtr pInfo)
>  
>      mtdev_close(proto_data->mtdev);
>      proto_data->mtdev = NULL;
> +    proto_data->num_touches = 0;
>  }
>  
>  static void
> diff --git a/src/synaptics.c b/src/synaptics.c
> index 853bfa8..d2fe960 100644
> --- a/src/synaptics.c
> +++ b/src/synaptics.c
> @@ -1086,6 +1086,7 @@ DeviceOff(DeviceIntPtr dev)
>      if (pInfo->fd != -1) {
>  	TimerCancel(priv->timer);
>  	xf86RemoveEnabledDevice(pInfo);
> +        SynapticsResetTouchHwState(priv->hwState);
>          if (priv->proto_ops->DeviceOffHook &&
>              !priv->proto_ops->DeviceOffHook(pInfo))
>              rc = !Success;

Makes sense to me, and I hope that it fixes
https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-input-synaptics/+bug/968845
too.

Reviewed-by: Chase Douglas <chase.douglas at canonical.com>


More information about the xorg-devel mailing list