diff options
author | Jason Gerecke <jason.gerecke@wacom.com> | 2019-08-01 10:49:41 -0700 |
---|---|---|
committer | Jason Gerecke <jason.gerecke@wacom.com> | 2019-08-12 14:49:03 -0700 |
commit | 4890de5f9a29e739591bed288528661f7c23f86d (patch) | |
tree | b23e3db880c96d79db6641657b61c86e2a2c815b | |
parent | a13f2bfe177b9eb0f747d1eb9044840f48d762cd (diff) | |
download | xf86-input-wacom-4890de5f9a29e739591bed288528661f7c23f86d.tar.gz |
Allow CursorProximity to take effect even if distance == 0 on tablet surface
The CursorProximity feature allows the relative-mode puck to be lifted a
smaller distance from the tablet surface than the full hardware prox
distance. This makes using the puck in relative mode much easier. In order
to simplify the code, 4893844f3f changed how the surface distance would
be determined. Instead of tracking the minimum (or maximum) distance
reported, the driver would use the value reported the moment a click
occurred. This works relatively well, but does require the user to make
at least one click before the CursorProximity feature takes effect.
Because the "uninitialized" value of `common->wcmMaxCursorDist` is zero,
this can prevent the CursorProsximity feature from taking effect if the
tablet itself reports a distance of 0 at the tablet surface. To fix this
we can just let the "uninitialized" value be -1 since such a distance
is not valid.
Ref: https://github.com/linuxwacom/xf86-input-wacom/issues/72
Fixes: 4893844f3f ("Modify wcmMaxCursorDist calculation to support non-inverted protocol 4")
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
-rw-r--r-- | src/wcmCommon.c | 2 | ||||
-rw-r--r-- | src/wcmValidateDevice.c | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/wcmCommon.c b/src/wcmCommon.c index bf04abe..361e3b6 100644 --- a/src/wcmCommon.c +++ b/src/wcmCommon.c @@ -1387,7 +1387,7 @@ static void commonDispatchDevice(InputInfoPtr pInfo, priv->wcmSurfaceDist, ds->proximity); - if (priv->wcmSurfaceDist) { + if (priv->wcmSurfaceDist >= 0) { if (priv->oldState.proximity) { if (abs(filtered.distance - priv->wcmSurfaceDist) diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c index 8fa3c76..dda2fff 100644 --- a/src/wcmValidateDevice.c +++ b/src/wcmValidateDevice.c @@ -930,6 +930,7 @@ Bool wcmPreInitParseOptions(InputInfoPtr pInfo, Bool is_primary, priv->wcmProxoutDist > common->wcmMaxDist) xf86Msg(X_CONFIG, "%s: %s invalid %d \n", pInfo->name, prop, priv->wcmProxoutDist); + priv->wcmSurfaceDist = -1; } priv->topX = xf86SetIntOption(pInfo->options, "TopX", 0); |