From f6c1efbc6d22f41fb8a4abd2f57db173a2ac3171 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 9 Mar 2012 14:20:35 +1000 Subject: Add an old_hw_state field to remember the last values Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas --- src/synaptics.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/synaptics.c') diff --git a/src/synaptics.c b/src/synaptics.c index e2153b9..13f1378 100644 --- a/src/synaptics.c +++ b/src/synaptics.c @@ -957,6 +957,7 @@ DeviceClose(DeviceIntPtr dev) priv->timer = NULL; free_shm_data(priv); SynapticsHwStateFree(&priv->hwState); + SynapticsHwStateFree(&priv->old_hw_state); SynapticsHwStateFree(&priv->local_hw_state); SynapticsHwStateFree(&priv->comm.hwState); return RetValue; @@ -1231,6 +1232,10 @@ DeviceInit(DeviceIntPtr dev) if (!priv->hwState) goto fail; + priv->old_hw_state = SynapticsHwStateAlloc(priv); + if (!priv->old_hw_state) + goto fail; + priv->local_hw_state = SynapticsHwStateAlloc(priv); if (!priv->local_hw_state) goto fail; @@ -1430,6 +1435,7 @@ ReadInput(InputInfoPtr pInfo) while (SynapticsGetHwState(pInfo, priv, hw)) { SynapticsCopyHwState(priv->hwState, hw); delay = HandleState(pInfo, hw, hw->millis, FALSE); + SynapticsCopyHwState(priv->old_hw_state, priv->hwState); newDelay = TRUE; } -- cgit v1.2.3