From 80483b5c06839ab57cbad314ae1adb692bfb59da Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Sat, 17 Apr 2010 20:45:31 +0200 Subject: Correctly report zero fingers This bug has been around since before alpha1, and yet the topic of commit c7ed4c, prior to alpha1, was about precisely this; With the bug, the last tracking id will sometimes be continued with a new touch, resulting in a cursor jump. This patch correctly sets zero fingers in HWData after receiving a zero-finger event. Signed-off-by: Henrik Rydberg --- src/hwdata.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hwdata.c b/src/hwdata.c index d696e07..9ec6241 100644 --- a/src/hwdata.c +++ b/src/hwdata.c @@ -40,7 +40,7 @@ static void accept_finger(struct HWData *hw) GETBIT(hw->mread[hw->nread], BIT_MT_POSITION_X) && GETBIT(hw->mread[hw->nread], BIT_MT_POSITION_Y)) { hw->mask[hw->nread] = hw->mread[hw->nread]; - hw->nfinger = ++hw->nread; + hw->nread++; } if (hw->nread < DIM_FINGER) hw->mread[hw->nread] = 0; @@ -49,6 +49,7 @@ static void accept_finger(struct HWData *hw) static void accept_packet(struct HWData *hw, const struct timeval* tv) { static const mstime_t ms = 1000; + hw->nfinger = hw->nread; hw->nread = 0; hw->mread[hw->nread] = 0; hw->evtime = tv->tv_usec / ms + tv->tv_sec * ms; -- cgit v1.2.3