Bug 105306 - Make touchpad hysteresis omnidirectional
Summary: Make touchpad hysteresis omnidirectional
Status: RESOLVED FIXED
Alias: None
Product: Wayland
Classification: Unclassified
Component: libinput (show other bugs)
Version: unspecified
Hardware: Other All
: high enhancement
Assignee: Wayland bug list
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 104828
  Show dependency treegraph
 
Reported: 2018-03-01 09:19 UTC by Daniel van Vugt
Modified: 2018-03-05 01:27 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
elliptical-hysteresis-v1.patch (6.86 KB, patch)
2018-03-01 09:19 UTC, Daniel van Vugt
Details | Splinter Review
0001-Introduce-omnidirectional-elliptical-hysteresis.patch (7.00 KB, patch)
2018-03-02 03:30 UTC, Peter Hutterer
Details | Splinter Review
hysteresis-test.c (5.02 KB, text/plain)
2018-03-02 04:01 UTC, Peter Hutterer
Details
hysteresis.gnuplot (425 bytes, text/plain)
2018-03-02 04:01 UTC, Peter Hutterer
Details

Description Daniel van Vugt 2018-03-01 09:19:09 UTC
Created attachment 137715 [details] [review]
elliptical-hysteresis-v1.patch

Make touchpad hysteresis omnidirectional.

This is to solve annoyances in the current algorithm observed as:
 * Moving a finger in small circles moves the cursor in squares.
 * Moving a finger in a curve snaps the cursor to vertical or horizontal lines only.
Comment 1 Peter Hutterer 2018-03-02 03:30:15 UTC
Created attachment 137744 [details] [review]
0001-Introduce-omnidirectional-elliptical-hysteresis.patch

rebased on master (400aadd5), typo fix in commit msg. no other changes
Comment 2 Peter Hutterer 2018-03-02 04:01:10 UTC
Created attachment 137745 [details]
hysteresis-test.c

For archiving purposes: a little c program that outputs the two different approaches, the one from here and the one from Bug 105018#c12
Comment 3 Peter Hutterer 2018-03-02 04:01:58 UTC
Created attachment 137746 [details]
hysteresis.gnuplot

For archiving purposes: a gnuplot script to visualize the output from attachment 137745 [details]
Comment 4 Daniel van Vugt 2018-03-02 04:20:51 UTC
I ran it but found the picture confusing at first. Now I understand it is distorted by the input data being square, and the result is good. Maybe a less confusing plot might be to only plot a circle of input points.
Comment 5 Peter Hutterer 2018-03-02 04:23:44 UTC
Konstantin, can you test attachment 137744 [details] [review] please to make sure it fixes or at least doesn't introduce any other bugs? If not, then I'll push this asap.
Comment 6 Hi-Angel 2018-03-02 10:08:07 UTC
(In reply to Peter Hutterer from comment #5)
> Konstantin, can you test attachment 137744 [details] [review] [review] please to make
> sure it fixes or at least doesn't introduce any other bugs? If not, then
> I'll push this asap.

Just tested, seems to work fine. FWIW though, I did not notice axis snapping until saw the bugreport — it was pretty small for me. But, it seeems, with this patch axis-snapping ceased to exist whatsoever.

Sorry for delay, I wanted to test this morning, but I couldn't make git to leave conflict markers for me (the patch didn't apply cleanly because of strange symbols in comments — dunno, bugs.freedesktop.org seem to have some problem with encoding). In the end I have simply used "patch" command, and it, turns out, leaves ".rej" files being a nice replacement to conflict markers (well, I've seen them before, but never looked into).
Comment 7 Daniel van Vugt 2018-03-02 10:47:26 UTC
The axis snapping is less obvious on high quality touchpads, like Apple. It is much more obvious on the worst touchpads like X1 Carbon gen4/gen5.
Comment 8 Daniel van Vugt 2018-03-02 11:29:14 UTC
(In reply to Hi-Angel from comment #6)

I just checked and Peter's patch (attachment 137744 [details] [review]) applies cleanly without any conflicts. You might have introduced some character encoding errors in the way you downloaded it?..

P.S. The complaint about the cursor moving in squares etc is not an uncommon one. I've seen other bug reports make the same observation. And while the hysteresis distance may be 0.5mm on the touchpad, on the screen it's much bigger than that. So precision is important.
Comment 9 Hi-Angel 2018-03-02 11:35:02 UTC
(In reply to Daniel van Vugt from comment #8)
> (In reply to Hi-Angel from comment #6)
> 
> I just checked and Peter's patch (attachment 137744 [details] [review] [review])
> applies cleanly without any conflicts. You might have introduced some
> character encoding errors in the way you downloaded it?..

I didn't find how to download raw attachment, so I simply opened the page, and copy-pasted the patch. And when I open the page, I see symbols like "  * | c |  x →  | r x". That "a with a cap" shouldn't be there. It looks like this both in Qutebrowser (read as Chromium) and Firefox.
Comment 10 Daniel van Vugt 2018-03-02 11:38:35 UTC
Yes, sorry, it probably can't be copy/pasted from a browser window due to the UTF-8 characters. They otherwise seem legal (and the libinput source uses them already so I had no hesitation).

Try this:

wget https://bugs.freedesktop.org/attachment.cgi?id=137744
and then rename the file.
Comment 11 Hi-Angel 2018-03-02 11:41:59 UTC
(In reply to Daniel van Vugt from comment #10)
> Yes, sorry, it probably can't be copy/pasted from a browser window due to
> the UTF-8 characters. They otherwise seem legal (and the libinput source
> uses them already so I had no hesitation).

UTF-8 symbols are definitely okay, it's a problem on the bugs.freedesktop.org's side :)

> Try this:
> 
> wget https://bugs.freedesktop.org/attachment.cgi?id=137744
> and then rename the file.

Thanks
Comment 12 Peter Hutterer 2018-03-03 05:44:58 UTC
fwiw, I used to use wget and got annoyed by the renaming, now I'm using curl instead: curl <url> > touchpad.log or even curl <url> | git am -s (the latter is a reason why we prefer git formatted commits :)

Thanks for testing, I'll push this on monday (and of course thanks for writing the patch :)
Comment 13 Peter Hutterer 2018-03-05 01:27:52 UTC
Pushed, thanks!


commit 6936a15558f7baa047bdb7e31604ef29be1ae552
Author: Daniel van Vugt <>
Date:   Thu Mar 1 17:03:28 2018 +0800

     Introduce omnidirectional (elliptical) hysteresis


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.