summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2010-04-17 20:45:31 +0200
committerHenrik Rydberg <rydberg@euromail.se>2010-04-18 01:01:47 +0200
commit80483b5c06839ab57cbad314ae1adb692bfb59da (patch)
tree007d6834f3401083fa3e66208791a0541f418b45
parentc63075febe60edc81d39bab22a77684df129a67d (diff)
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 <rydberg@euromail.se>
-rw-r--r--src/hwdata.c3
1 files changed, 2 insertions, 1 deletions
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)
40 GETBIT(hw->mread[hw->nread], BIT_MT_POSITION_X) && 40 GETBIT(hw->mread[hw->nread], BIT_MT_POSITION_X) &&
41 GETBIT(hw->mread[hw->nread], BIT_MT_POSITION_Y)) { 41 GETBIT(hw->mread[hw->nread], BIT_MT_POSITION_Y)) {
42 hw->mask[hw->nread] = hw->mread[hw->nread]; 42 hw->mask[hw->nread] = hw->mread[hw->nread];
43 hw->nfinger = ++hw->nread; 43 hw->nread++;
44 } 44 }
45 if (hw->nread < DIM_FINGER) 45 if (hw->nread < DIM_FINGER)
46 hw->mread[hw->nread] = 0; 46 hw->mread[hw->nread] = 0;
@@ -49,6 +49,7 @@ static void accept_finger(struct HWData *hw)
49static void accept_packet(struct HWData *hw, const struct timeval* tv) 49static void accept_packet(struct HWData *hw, const struct timeval* tv)
50{ 50{
51 static const mstime_t ms = 1000; 51 static const mstime_t ms = 1000;
52 hw->nfinger = hw->nread;
52 hw->nread = 0; 53 hw->nread = 0;
53 hw->mread[hw->nread] = 0; 54 hw->mread[hw->nread] = 0;
54 hw->evtime = tv->tv_usec / ms + tv->tv_sec * ms; 55 hw->evtime = tv->tv_usec / ms + tv->tv_sec * ms;