diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2014-09-05 15:14:47 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2014-09-17 14:50:05 +1000 |
commit | 2dd60417450af4ac4f9938e09b06707dd91bddfb (patch) | |
tree | a426d684f18a540e4d377c6b4bcdb06aac4750f4 /src/synaptics.c | |
parent | 9de611219bebd9b101b98bb79cc0173115ee1833 (diff) |
When resetting, reset the open slots to -1
open_slots holds the slot index, resetting it to 0 is a bad idea. And make
sure that we do reset after DEVICE_INIT. We already do so on DEVICE_CLOSE, but
after the first DEVICE_ON the data could still be random.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit afbbcfa10eb3a2295823720907f35bb59972dd82)
Diffstat (limited to 'src/synaptics.c')
-rw-r--r-- | src/synaptics.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/synaptics.c b/src/synaptics.c index b49957c..4b0fe2e 100644 --- a/src/synaptics.c +++ b/src/synaptics.c @@ -1026,6 +1026,8 @@ error: static void SynapticsReset(SynapticsPrivate * priv) { + int i; + SynapticsResetHwState(priv->hwState); SynapticsResetHwState(priv->local_hw_state); SynapticsResetHwState(priv->comm.hwState); @@ -1055,7 +1057,9 @@ SynapticsReset(SynapticsPrivate * priv) priv->prev_z = 0; priv->prevFingers = 0; priv->num_active_touches = 0; - memset(priv->open_slots, 0, priv->num_slots * sizeof(int)); + + for (i = 0; i < priv->num_slots; i++) + priv->open_slots[i] = -1; } static int @@ -1352,6 +1356,8 @@ DeviceInit(DeviceIntPtr dev) InitDeviceProperties(pInfo); XIRegisterPropertyHandler(pInfo->dev, SetProperty, NULL, NULL); + SynapticsReset(priv); + return Success; fail: |