wcmLastToolSerial should not be reset by every event. It is valid
for the whole life of a tool when it is in-prox.

Signed-off-by: Ping Cheng <[email protected]>
---
 src/wcmUSB.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index 052b777..6087ded 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -894,7 +894,6 @@ static void usbParseEvent(LocalDevicePtr local,
        usbParseChannel(local,channel);
 
 skipEvent:
-       common->wcmLastToolSerial = 0;
        common->wcmEventCnt = 0;
 }
 
@@ -1145,6 +1144,10 @@ static void usbParseChannel(LocalDevicePtr local, int 
channel)
                return;
        }
 
+       /*reset the serial number when the tool is going out */
+       if (!ds.proximity)
+               common->wcmLastToolSerial = 0;
+
        /* dispatch event */
        wcmEvent(common, channel, ds);
 }
-- 
1.7.1.1


------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to