diff options
author | Jason Gerecke <jason.gerecke@wacom.com> | 2019-06-19 09:05:46 -0700 |
---|---|---|
committer | Jason Gerecke <jason.gerecke@wacom.com> | 2019-08-12 14:48:59 -0700 |
commit | 2cf46016810056d3fd08c6b7dec3b33089f64672 (patch) | |
tree | 7c061b6f7c0b92a5436faa73003047f6082a1a10 /src/wcmCommon.c | |
parent | daafdda6e90d9c36ad8f56be1f03d0b402595f30 (diff) | |
download | xf86-input-wacom-2cf46016810056d3fd08c6b7dec3b33089f64672.tar.gz |
Change wcmCursorProxoutDist from a common to a private property
Refactors wcmCursorProxoutDist and related variables so that the information
is tracked on a per-tool basis rather than being considered a common property
of the tablet. This is in preparation for a follow-up patch which will expose
the proxout feature to tools other than the cursor/puck.
Ref: https://github.com/linuxwacom/input-wacom/issues/54
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Diffstat (limited to 'src/wcmCommon.c')
-rw-r--r-- | src/wcmCommon.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/wcmCommon.c b/src/wcmCommon.c index 3c2bc84..d247f14 100644 --- a/src/wcmCommon.c +++ b/src/wcmCommon.c @@ -1365,7 +1365,7 @@ static void commonDispatchDevice(InputInfoPtr pInfo, } } - /* force out-prox when distance is outside wcmCursorProxoutDist for pucks */ + /* force out-prox when distance from surface exceeds wcmProxoutDist */ if (IsCursor(priv)) { /* Assume the the user clicks the puck buttons while @@ -1375,29 +1375,29 @@ static void commonDispatchDevice(InputInfoPtr pInfo, * 4 for many many kernel versions). */ if (filtered.buttons) - common->wcmMaxCursorDist = filtered.distance; + priv->wcmSurfaceDist = filtered.distance; - DBG(10, common, "Distance over" + DBG(10, priv, "Distance over" " the tablet: %d, ProxoutDist: %d current" - " min/max %d hard prox: %d\n", + " surface %d hard prox: %d\n", filtered.distance, - common->wcmCursorProxoutDist, - common->wcmMaxCursorDist, + priv->wcmProxoutDist, + priv->wcmSurfaceDist, ds->proximity); - if (common->wcmMaxCursorDist) { + if (priv->wcmSurfaceDist) { if (priv->oldState.proximity) { - if (abs(filtered.distance - common->wcmMaxCursorDist) - > common->wcmCursorProxoutDist) + if (abs(filtered.distance - priv->wcmSurfaceDist) + > priv->wcmProxoutDist) filtered.proximity = 0; } /* once it is out. Don't let it in until a hard in */ - /* or it gets inside wcmCursorProxoutDist */ + /* or it gets inside wcmProxoutDist */ else { - if (abs(filtered.distance - common->wcmMaxCursorDist) > - common->wcmCursorProxoutDist && ds->proximity) + if (abs(filtered.distance - priv->wcmSurfaceDist) > + priv->wcmProxoutDist && ds->proximity) return; if (!ds->proximity) return; @@ -1554,7 +1554,7 @@ WacomCommonPtr wcmNewCommon(void) common->wcmMaxTouchY = 1024; /* max touch Y value */ common->wcmMaxStripX = 4096; /* Max fingerstrip X */ common->wcmMaxStripY = 4096; /* Max fingerstrip Y */ - common->wcmCursorProxoutDistDefault = PROXOUT_INTUOS_DISTANCE; + common->wcmProxoutDistDefault = PROXOUT_INTUOS_DISTANCE; /* default to Intuos */ common->wcmSuppress = DEFAULT_SUPPRESS; /* transmit position if increment is superior */ |