Reset touch state on DeviceOff (#49161)

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

X.Org Bug 49161 <http://bugs.freedesktop.org/show_bug.cgi?id=49161>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
This commit is contained in:
Peter Hutterer
2012-04-24 15:31:36 +10:00
parent f300adb027
commit 9ecf505c64
2 changed files with 2 additions and 0 deletions

View File

@@ -128,6 +128,7 @@ UninitializeTouch(InputInfoPtr pInfo)
mtdev_close(proto_data->mtdev);
proto_data->mtdev = NULL;
proto_data->num_touches = 0;
}
static void

View File

@@ -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;