summaryrefslogtreecommitdiff
path: root/src/synaptics.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-04-19 16:39:41 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-04-20 09:23:11 +1000
commit3822d58777768b351940e58d8608ba9ab877d134 (patch)
treecda08254520ebca4b39ff1114351132d69df4819 /src/synaptics.c
parent11d8929647a67258ca86121a45ea638ca7299237 (diff)
Ensure hw millis are monotonic (#48777)
The eventcomm backend takes the timestamp from the kernel, but the timer uses the timer's "now". This timestamp may be later than the one from the next event we read from the kernel, causing a negative dtime in get_delta() and a cursor jump by (unsigned int)-1. Ensure that the new event's timestamp is at least the last used one. X.Org Bug 48777 <http://bugs.freedesktop.org/show_bug.cgi?id=48777> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Gavin Troy <gavtroy@gmail.com>
Diffstat (limited to 'src/synaptics.c')
-rw-r--r--src/synaptics.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/synaptics.c b/src/synaptics.c
index 350567d..8c34234 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -1635,6 +1635,10 @@ ReadInput(InputInfoPtr pInfo)
hw->cumulative_dy = priv->hwState->cumulative_dy;
}
+ /* timer may cause actual events to lag behind (#48777) */
+ if (priv->hwState->millis > hw->millis)
+ hw->millis = priv->hwState->millis;
+
SynapticsCopyHwState(priv->hwState, hw);
delay = HandleState(pInfo, hw, hw->millis, FALSE);
newDelay = TRUE;