summaryrefslogtreecommitdiff
path: root/src/synaptics.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-03-09 14:20:35 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-03-14 08:46:42 +1000
commitf6c1efbc6d22f41fb8a4abd2f57db173a2ac3171 (patch)
treeb27f84249e8d54d817cc2812e6f0cb44dd9da6a6 /src/synaptics.c
parentbad1b75524f2fa882e9b6ac7160463fbd3b5cccf (diff)
Add an old_hw_state field to remember the last values
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Diffstat (limited to 'src/synaptics.c')
-rw-r--r--src/synaptics.c6
1 files changed, 6 insertions, 0 deletions
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;
}