diff options
author | Jason Gerecke <killertofu@gmail.com> | 2017-12-08 13:55:33 -0800 |
---|---|---|
committer | Jason Gerecke <killertofu@gmail.com> | 2017-12-18 11:36:04 -0800 |
commit | 2c191f041d658d83aa86b72cc49540a3387bb61a (patch) | |
tree | 36727b1e24ad8177d93f260ffe7ad2e9fa22bbf5 /src/wcmCommon.c | |
parent | ce72a0048b56089f3946f9bc90163fcad7222f86 (diff) | |
download | xf86-input-wacom-2c191f041d658d83aa86b72cc49540a3387bb61a.tar.gz |
Reset filter when tip is touched to tablet
Coordinate averaging is useful for producing smooth strokes, but this
averaging can cause button events to be sent at the wrong location.
In particular, when making a series of quick strokes with an AES pen,
the actual location the pen contacts the display can be some distance
away from the first (low-quality) position report. This can result in
"hook" artifacts if it is still influencing the averaged pointer
position when the pen goes down. This can also be seen if the RawSample
parameter is increased significantly.
To prevent these artifacts from appearing, we reset the averaging filter
whenever the tip is pressed. This ensures that the event event is sent
at the pen's actual location, plus or minus some (probably smaller) noise.
In theory these artifacts could still appear if drawing were triggered
by a button other than the tip, but that would be a quite non-standard
setup.
https://sourceforge.net/p/linuxwacom/bugs/338/
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Diffstat (limited to 'src/wcmCommon.c')
-rw-r--r-- | src/wcmCommon.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/wcmCommon.c b/src/wcmCommon.c index bd5039c..d32d3b9 100644 --- a/src/wcmCommon.c +++ b/src/wcmCommon.c @@ -1239,6 +1239,15 @@ static void commonDispatchDevice(InputInfoPtr pInfo, if (!priv->oldState.proximity) wcmResetSampleCounter(pChannel); + /* Reset filter whenever the tip is touched to the + * screen to ensure clicks are sent from the pen's + * actual position. Don't reset on other buttons or + * tip-up, or else there may be a noticible jump/ + * hook produced in the middle/end of the stroke. + */ + if ((filtered.buttons & PRESSURE_BUTTON) && !(priv->oldState.buttons & PRESSURE_BUTTON)) + wcmResetSampleCounter(pChannel); + wcmFilterCoord(common,pChannel,&filtered); } |