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

When out of proximity, changes to values to X/Y/etc are not
meaningful.  Some non-wacom tablets will send these values while
out of proximity.

Although we correctly ignore their values elsewhere, its more
efficient to ignore right away.

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

diff --git a/src/wcmCommon.c b/src/wcmCommon.c
index f68bc8b..1a87027 100644
--- a/src/wcmCommon.c
+++ b/src/wcmCommon.c
@@ -805,15 +805,22 @@ void wcmSendEvents(InputInfoPtr pInfo, const 
WacomDeviceState* ds)
  *  if not.
  ****************************************************************************/
 
-static int wcmCheckSuppress(WacomCommonPtr common, const WacomDeviceState* 
dsOrig,
-       WacomDeviceState* dsNew)
+static int wcmCheckSuppress(WacomCommonPtr common,
+                           const WacomDeviceState* dsOrig,
+                           WacomDeviceState* dsNew)
 {
        int suppress = common->wcmSuppress;
        /* NOTE: Suppression value of zero disables suppression. */
        int returnV = 0;
 
-       if (dsOrig->buttons != dsNew->buttons) returnV = 1;
+       /* Ignore all other changes that occur after initial out-of-prox. */
+       if (!dsNew->proximity && !dsOrig->proximity)
+               return 0;
+
+       /* Never ignore proximity changes. */
        if (dsOrig->proximity != dsNew->proximity) returnV = 1;
+
+       if (dsOrig->buttons != dsNew->buttons) returnV = 1;
        if (dsOrig->stripx != dsNew->stripx) returnV = 1;
        if (dsOrig->stripy != dsNew->stripy) returnV = 1;
        if (ABS(dsOrig->tiltx - dsNew->tiltx) > suppress) returnV = 1;
-- 
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