Commit 5486ab34 authored by Chase Douglas's avatar Chase Douglas

Introduce SynapticsCopyHwState function

Signed-off-by: default avatarChase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent 5658a2f6
......@@ -218,7 +218,7 @@ ALPSReadHwState(InputInfoPtr pInfo,
ALPS_process_packet(buf, hw);
*hwRet = *hw;
SynapticsCopyHwState(hwRet, hw);
return TRUE;
}
......
......@@ -720,7 +720,7 @@ EventReadHwState(InputInfoPtr pInfo,
EventProcessTouch(pInfo);
hw->numFingers = count_fingers(comm);
hw->millis = 1000 * ev.time.tv_sec + ev.time.tv_usec / 1000;
*hwRet = *hw;
SynapticsCopyHwState(hwRet, hw);
return TRUE;
}
break;
......
......@@ -650,7 +650,7 @@ PS2ReadHwStateProto(InputInfoPtr pInfo,
}
}
hw->millis = GetTimeInMillis();
*hwRet = *hw;
SynapticsCopyHwState(hwRet, hw);
return TRUE;
}
......
......@@ -1337,7 +1337,7 @@ timerFunc(OsTimerPtr timer, CARD32 now, pointer arg)
sigstate = xf86BlockSIGIO();
priv->hwState->millis += now - priv->timer_time;
*hw = *priv->hwState;
SynapticsCopyHwState(hw, priv->hwState);
delay = HandleState(pInfo, hw, hw->millis, TRUE);
priv->timer_time = now;
......@@ -1378,7 +1378,7 @@ ReadInput(InputInfoPtr pInfo)
Bool newDelay = FALSE;
while (SynapticsGetHwState(pInfo, priv, hw)) {
*priv->hwState = *hw;
SynapticsCopyHwState(priv->hwState, hw);
delay = HandleState(pInfo, hw, hw->millis, FALSE);
newDelay = TRUE;
}
......
......@@ -41,3 +41,10 @@ SynapticsHwStateFree(struct SynapticsHwState **hw)
free(*hw);
*hw = NULL;
}
void
SynapticsCopyHwState(struct SynapticsHwState *dst,
const struct SynapticsHwState *src)
{
*dst = *src;
}
......@@ -95,5 +95,7 @@ extern struct SynapticsProtocolOperations psm_proto_operations;
extern struct SynapticsHwState *SynapticsHwStateAlloc(SynapticsPrivate *priv);
extern void SynapticsHwStateFree(struct SynapticsHwState **hw);
extern void SynapticsCopyHwState(struct SynapticsHwState *dst,
const struct SynapticsHwState *src);
#endif /* _SYNPROTO_H_ */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment