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.1 ------------------------------------------------------------------------------ Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel