From: Chris Bagwell <ch...@cnpbagwell.com>

Old logic was relying on multiple sync windows occuring while
out of proximity to reset averaging window; which doesn't always happen.

Signed-off-by: Chris Bagwell <ch...@cnpbagwell.com>
---
 src/wcmCommon.c |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/src/wcmCommon.c b/src/wcmCommon.c
index f77cad7..14f8f92 100644
--- a/src/wcmCommon.c
+++ b/src/wcmCommon.c
@@ -851,14 +851,10 @@ static int wcmCheckSuppress(WacomCommonPtr common, const 
WacomDeviceState* dsOri
 /* reset raw data counters for filters */
 static void resetSampleCounter(const WacomChannelPtr pChannel)
 {
-       /* if out of proximity, reset hardware filter */
-       if (!pChannel->valid.state.proximity)
-       {
-               pChannel->nSamples = 0;
-               pChannel->rawFilter.npoints = 0;
-               pChannel->rawFilter.statex = 0;
-               pChannel->rawFilter.statey = 0;
-       }
+       pChannel->nSamples = 0;
+       pChannel->rawFilter.npoints = 0;
+       pChannel->rawFilter.statex = 0;
+       pChannel->rawFilter.statey = 0;
 }
 
 /*****************************************************************************
@@ -972,6 +968,9 @@ void wcmEvent(WacomCommonPtr common, unsigned int channel,
                if (RAW_FILTERING(common) && common->wcmModel->FilterRaw &&
                    ds.proximity && ds.device_type != PAD_ID)
                {
+                       if (!pLast->proximity)
+                               resetSampleCounter(pChannel);
+
                        if (common->wcmModel->FilterRaw(common,pChannel,&ds))
                        {
                                DBG(10, common,
@@ -985,7 +984,6 @@ void wcmEvent(WacomCommonPtr common, unsigned int channel,
                suppress = wcmCheckSuppress(common, pLast, &ds);
                if (!suppress)
                {
-                       resetSampleCounter(pChannel);
                        return;
                }
        }
-- 
1.7.3.2


------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to