From cdb18cbc4b1b8860f3480d58a69a2f5afcc09fe5 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 8 Sep 2010 10:06:11 +1000 Subject: [PATCH] eventcomm: Clip x/y coordinates into axis range (#23890) Some touchpads report X values significantly higher than the announced x/y axis ranges. This leads to cursor jumps on some touchpads. X.Org Bug 23890 Signed-off-by: Peter Hutterer --- src/eventcomm.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/eventcomm.c b/src/eventcomm.c index 85dfd09..0411358 100644 --- a/src/eventcomm.c +++ b/src/eventcomm.c @@ -393,16 +393,16 @@ EventReadHwState(InputInfoPtr pInfo, case EV_ABS: switch (ev.code) { case ABS_X: - hw->x = ev.value; + hw->x = max(priv->minx, min(ev.value, priv->maxx)); break; case ABS_Y: - hw->y = ev.value; + hw->y = max(priv->miny, min(ev.value, priv->maxy)); break; case ABS_PRESSURE: - hw->z = ev.value; + hw->z = max(priv->minp, min(ev.value, priv->maxp)); break; case ABS_TOOL_WIDTH: - hw->fingerWidth = ev.value; + hw->fingerWidth = max(priv->minw, min(ev.value, priv->maxw)); break; } break; -- 1.7.2.2