Bug 103330 - Edge exclusion zone too wide for large touchpad
Summary: Edge exclusion zone too wide for large touchpad
Status: RESOLVED FIXED
Alias: None
Product: Wayland
Classification: Unclassified
Component: libinput (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Wayland bug list
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 103208
  Show dependency treegraph
 
Reported: 2017-10-18 08:13 UTC by Peter Y. Chuang
Modified: 2017-10-26 04:48 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Peter Y. Chuang 2017-10-18 08:13:36 UTC
Currently, the exclusion zones of a touchpad is set at 8% of the width on either sides and 5% of the height at the top edge, if my understanding is correct.

For extra large touchpads such as ones on newer MacBooks, however, the exclusion zones are too large. E.g. the touchpad on 13-inch MacBook Pro measures at 135x84mm. 8% on both sides means more than 1cm on both sides of the touchpad cannot be used.

Given that touch-size-based palm rejection is working quite well in most situations, exclusion zones as narrow as 3mm on both sides and the top are sufficient in rejeting accidental touches on the edges in my own tests.

Related discussion: https://github.com/Dunedan/mbp-2016-linux/issues/20#issuecomment-323012888
Comment 1 Peter Hutterer 2017-10-18 22:33:34 UTC
good point. we should cap these at 8mm or something, but I'd like to figure out where exactly we can start detecting the full palm size on those devices. The problem with the edges is that we don't get a full finger size so a palm looks like a normal finger. So the question is - where does a finger start triggering a palm based on size? You should be able to modify tools/libinput-measure-touch-size to query that information. Or at least use it as base for a new tool that figures this out.
Comment 2 Peter Y. Chuang 2017-10-19 06:45:37 UTC
> where does a finger start triggering a palm based on size? You should be able 
> to modify tools/libinput-measure-touch-size to query that information. Or at 
> least use it as base for a new tool that figures this out.

I'm not sure how to go about testing that. However, since 3mm seems pretty sufficient in my own use, I suppose touch-size measurement is more or less right 3mm away from the edges. Though before we can say for sure where, you may add 1 or 2 mm just to be safe.

FWIW, macOS doesn't appear to have exclusion zones at all, though it rejects palm touches on the edge well enough for normal usage (far from perfect though, if one tests it for every conceivable way a palm can touch the touchpad).
Comment 3 Peter Hutterer 2017-10-19 07:39:57 UTC
starting point: collect the x/y together with the major/minor values. store them in a list and record *a lot* of motions where you move with your finger normally down around/towards/away from the edges. Print all the data, then use gnuplot or python to get some statistics and visualization. You'll probably find that on some x or y coordinates the detected maximum/mean/average values for the major/minors drop off.

for gnuplot, I'd print two diagrams, one with x/minor as x/y-axes, one with y/major as x/y-axes.

come to think of it, you're probably better off recording a single long evemu recording first, then running this through through a script (instead of re-recording every time). Look at this repo here for some example scripts that do that: https://github.com/whot/input-data-analysis/
Comment 4 Peter Hutterer 2017-10-23 05:42:40 UTC
https://lists.freedesktop.org/archives/wayland-devel/2017-October/035485.html
quick fix for now
Comment 5 Peter Y. Chuang 2017-10-23 18:47:52 UTC
I haven't quite figured out how to analyse the recordings with python scripts, unfortunately. Sorry about that. However, I would be more than happy to provide you with more evemu recording if that helps.
Comment 6 Peter Hutterer 2017-10-25 01:19:04 UTC
commit 3e9e0e2eb18f0eae5ffe2be756903d92b8b88f75
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Oct 23 15:30:41 2017 +1000

    touchpad: cap the edge palm detection zones at 8mm
Comment 7 Peter Y. Chuang 2017-10-25 03:34:29 UTC
So do you still want me to have a go at making some evemu recordings around the edges?
Comment 8 Peter Hutterer 2017-10-25 03:48:40 UTC
I'd say give the above commit a try and let's see how we go. it reduces the edge size which was the main issue in this bug. 8mm is large enough that by then the real palm detection should kick in. so if there's another issue with palm detection, it's probably better to file a new bug
Comment 9 Peter Y. Chuang 2017-10-25 04:02:24 UTC
As I said, I've narrowed it before to 3mm. So I'd say it can be narrower still.
Comment 10 Peter Y. Chuang 2017-10-25 04:11:03 UTC
Also:

	/* palm edges are 8% of the width on each side up to a max of 8mm */
	mm.x = min(8, width * 0.08);
	edges = evdev_device_mm_to_units(device, &mm);
	tp->palm.left_edge = edges.x;

	mm.x = width * 0.92;
	edges = evdev_device_mm_to_units(device, &mm);
	tp->palm.right_edge = edges.x;

	if (!tp->buttons.has_topbuttons) {
		/* top edge is 5% of the height */
		mm.y = height * 0.05;
		edges = evdev_device_mm_to_units(device, &mm);
		tp->palm.upper_edge = edges.y;

It appears that only the left edge has been changed, if I'm not mistaken.
Comment 11 Peter Hutterer 2017-10-26 04:48:08 UTC
oops, thanks. I pushed a fix as

commit ed52002c8ddeac218ae88231d5a8f759f8733266 (tmp-today/master)
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Oct 23 15:30:41 2017 +1000

    touchpad: cap the edge palm detection zones at 8mm


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.