Repository navigation
Conversation
When fingers lift off the touchpad, a ghost contact sometimes shows up for one or two frames. libinput sees a very short touch and turns it into a tap, so the end of a two-finger scroll sometimes clicks. The same thing happens when a lifting contact shrinks below SizeMin. It's lifted because it's invalid, then it's valid again in the next frame and gets reported as a new touch. With MinContactFrames, the daemon waits until a contact has been seen for that many frames in a row before reporting it. A contact that was lifted has to wait again. BTN_TOOL_* only counts reported contacts. It's off by default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HAFqWPtgujTmWED4uYFC1c
As a finger lifts off, its signal fades over a few frames and its center moves. This shows up as a jump right before the lift. After a slow scroll, apps with kinetic scrolling see that jump and flick the page. Store the amplitude of the fitted gaussian on each contact. While a contact's amplitude is dropping and below LiftThreshold times its peak, it can slow down, but not speed up or change direction. It's off by default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HAFqWPtgujTmWED4uYFC1c
Turn on MinContactFrames and LiftThreshold for the SLS2 touchpad, and lower PositionThresholdMin so slow movement isn't dropped. With the old value, a scroll that slowed down before the fingers lifted never reported the slowdown, so apps flicked based on the earlier speed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HAFqWPtgujTmWED4uYFC1c
Make the Surface Laptop Studio 2 touchpad nicer to use
Author
|
@qzed is this something that could be merged in? Anything I should be doing to get it in? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On the Surface Laptop Studio 2 touchpad, lifting fingers can cause:
I spent quite a bit of time tuning it getting Claude to fix it up, and TBH I didn't look at the code a lot. But I've been using it quite a bit locally and it's much nicer.
Cause
SizeMin, get lifted as invalid, and be reported again as a new touch a frame later.PositionThresholdMin(about 20 units per frame on this pad) drops slow movement, so apps never see the slowdown before the lift.Changes
MinContactFrames([Touchscreen],[Touchpad]): only report a contact after it has been seen this many frames in a row. A lifted contact has to wait again.LiftThreshold([Contacts]): while a contact's signal is dropping and below this fraction of its peak, it can slow down but not speed up or change direction. Uses the gaussian fit amplitude, now stored on each contact.MinContactFrames = 3,LiftThreshold = 0.9,PositionThresholdMin = 0.01.Both options are off by default. They could probably be on for all touchpads:
MinContactFrames = 3delays new touches by about 24 ms (a real tap is 50 ms or more), andLiftThresholdadds no delay. The defaults can be changed here if that's preferred.Not included
Validator::check_contacttreats unstable contacts as valid, which skipstrack_validity. Fixing that would cover the second tap case for everyone, but changes default behaviour.BTN_TOOL_*could count only the slots actually sent to uinput.Testing
On a Surface Laptop Studio 2 (
045E:0C46):LiftThreshold: contacts that sped up right before lifting went from 60 to 5 out of 123, and direction changes from 21 to 2.