Bug 99976 - Clickpad button presses registered wrongly
Summary: Clickpad button presses registered wrongly
Alias: None
Product: Wayland
Classification: Unclassified
Component: libinput (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Wayland bug list
QA Contact:
Depends on:
Reported: 2017-02-27 00:18 UTC by Tom Hughes
Modified: 2017-03-01 22:37 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:

evemu log (92.47 KB, text/plain)
2017-02-27 19:22 UTC, Tom Hughes
event log (4.64 KB, text/plain)
2017-02-27 19:23 UTC, Tom Hughes

Description Tom Hughes 2017-02-27 00:18:02 UTC
Testing a 1.7.x pre-release build (from https://koji.fedoraproject.org/koji/taskinfo?taskID=18007385) of libinput I am experiencing presses of clickpad buttons being reported wrongly.

It doesn't make much sense but everything seems to work normally within one window (this is running Gnome with Wayland on F25) but as soon as I move to a different window clicks on the middle or right button are reported as left button clicks - that much I have confirmed using libinput-debug-events to monitor events.

The incorrect reporting seems to persist for as long as my finger remains in contact with the touchpad no matter how many times I click but lifting it right off the pad briefly normally fixes things and causes the next click to be reported correctly though sometimes it takes a couple of attempts, especially for the right button.
Comment 1 Peter Hutterer 2017-02-27 02:21:44 UTC
run evemu-record in the background please (against the touchpad device) and libinput-debug-events at the same time. reproduce the bug, then attach the evemu output here. Should make it possible to replay the lot here.
Comment 2 Tom Hughes 2017-02-27 19:22:31 UTC
Created attachment 129958 [details]
evemu log

Here's the evemu log...
Comment 3 Tom Hughes 2017-02-27 19:23:59 UTC
Created attachment 129959 [details]
event log

Here's the event log - started shortly after the evemu log and stopped just before it.

As you can see there are three clicks - a left click in one window then I moved to another window and middle clicked which registered as left then I lifted off and clicked again and it registered as middle.
Comment 4 Peter Hutterer 2017-03-01 01:51:49 UTC
Found it, patch available on the list:

FTR, the triggering sequence is around
  E: 4.227286 0003 0035 1828      # EV_ABS / ABS_MT_POSITION_X    1828

The pressure goes below the threshold, switching the touch to end, then hover/ The actual end event is papered over this way (as seen and by the button state machine), the button state triggers on the current position (1828/803) which is in AREA. When the new touch comes down in 1756/1769 we're already in state AREA and don't update, hence the left button click despite these coordinates being in the middle button area.
Comment 5 Tom Hughes 2017-03-01 19:16:38 UTC
I can confirm that patch seems to fix the problem for me. Thanks.
Comment 6 Peter Hutterer 2017-03-01 22:37:48 UTC
commit c0dbd6eb38c000ebe10c25d07152bb6154bcc73e
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Mar 1 11:26:06 2017 +1000

    touchpad: ignore hovering touches for the software button state

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.