diff options
author | Wei-Han Chen <stimim@google.com> | 2018-09-28 15:16:08 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-09-28 10:10:57 -0700 |
commit | 64c792829c2fd6bda4985e2add424cce41c5cfd9 (patch) | |
tree | f0f4fe366ea0c329001d6c97635f4b119699dac5 | |
parent | acfd14a3345e7b7fa3fd3520c5b399fe6229d3cc (diff) | |
download | chrome-ec-64c792829c2fd6bda4985e2add424cce41c5cfd9.tar.gz |
usb_hid_touchpad: set confidence bit on finger leave
When finger is leaving, the confidence should be '1', since it is
not a plam.
Some background:
Since CL:617811, Linux kernel treats a finger whose confidence equal
to 0 as a "palm", and override its width and height with max value.
Therefore, when we are reporting a finger leaving event, if the
confidence is 0, the finger will quickly become a fat finger (max
width and heigh, locates at top-left corner), and then leave. This
will confuse gesture library, and might cause unintended behaviors.
BRANCH=nocturne
BUG=b:116321493
TEST=manually on whiskers
Signed-off-by: Wei-Han Chen <stimim@chromium.org>
Change-Id: I30be0e5efeb6c2215795565dce8c2da23892939f
Reviewed-on: https://chromium-review.googlesource.com/1250584
Commit-Ready: Wei-Han Chen <stimim@chromium.org>
Tested-by: Wei-Han Chen <stimim@chromium.org>
Reviewed-by: Tai-Hsu Lin <sheckylin@chromium.org>
-rw-r--r-- | driver/touchpad_elan.c | 2 | ||||
-rw-r--r-- | driver/touchpad_st.c | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/driver/touchpad_elan.c b/driver/touchpad_elan.c index 712125a021..f0e456b525 100644 --- a/driver/touchpad_elan.c +++ b/driver/touchpad_elan.c @@ -240,6 +240,8 @@ static int elan_tp_read_report(void) finger_status[i] = 1; } else if (finger_status[i]) { report.finger[ri].id = i; + /* When a finger is leaving, it's not a plam */ + report.finger[ri].confidence = 1; ri++; finger_status[i] = 0; } diff --git a/driver/touchpad_st.c b/driver/touchpad_st.c index cde1a07edb..c445f1dbf5 100644 --- a/driver/touchpad_st.c +++ b/driver/touchpad_st.c @@ -205,6 +205,8 @@ static int st_tp_parse_finger(struct usb_hid_touchpad_report *report, break; case ST_TP_EVENT_ID_LEAVE_POINTER: report->finger[i].id = event->finger.touch_id; + /* When a finger is leaving, it's not a palm */ + report->finger[i].confidence = 1; break; } return i + 1; |