AgeCommit message (Collapse)AuthorFilesLines
2018-03-08tools: record udev properties in libinput-recordPeter Hutterer3-1/+67
Only the ones we care about in libinput but for those it's handy to know which ones are set (especially the LIBINPUT_MODEL ones). Signed-off-by: Peter Hutterer <> fix vcs_tag fallback argumentPeter Hutterer1-2/+2
This needs to be specified as keyword argument, and meson < 0.41 doesn't allow for a missing fallback. Signed-off-by: Peter Hutterer <>
2018-03-07touchpad: handle a palm down in the tapped statePeter Hutterer3-339/+642
We expected the first event after TAPPED to be a finger down. If that finger has been recognised as palm, the finger state isn't TOUCH_BEGIN so we get an invalid state in our FSM. libinput bug: 0: invalid tap event TAP_EVENT_PALM in state TAP_STATE_TAPPED Signed-off-by: Peter Hutterer <>
2018-03-07meson: make libinput-git-version.h a source of libinput-recordPeter Hutterer1-5/+5
Fixes the dependency chain, otherwise a race condition between building libinput-record and building the git version header causes random build failures. Signed-off-by: Peter Hutterer <>
2018-03-06tools: add the git version in the libinput-record outputPeter Hutterer3-0/+10
Signed-off-by: Peter Hutterer <>
2018-03-05touchpad: enable palm detection on tablets' touchpadsPeter Hutterer4-6/+25 Signed-off-by: Peter Hutterer <>
2018-03-05touchpad: init touch size range based on the udev propertyPeter Hutterer1-8/+6
No need to hardcode Apple here, if we have a udev property for this, let's use it. Signed-off-by: Peter Hutterer <>
2018-03-05pad: use libwacom to get the evdev to button number mappingPeter Hutterer3-15/+227
Some of wacom's tablets, notably the Bamboo series, have a non-predictable scheme of mapping the buttons to numeric button numbers in libwacom. Since we promise sequential button numbers, we need to have those identical to libwacom, otherwise it's impossible to map the two together. Most tablets have a predictable mapping, so this does not affect the majority of devices. For the old-style bamboos, this swaps the buttons around with the buttons being ordered vertically top-to-bottom in libwacom. Signed-off-by: Peter Hutterer <> Acked-by: Jason Gerecke <>
2018-03-05test: don't use litest_is_pad_button_event for a few testsPeter Hutterer1-12/+13
That function requires us to know which button we're testing for. Because of the upcoming libwacom changes, we don't know which button we're about to get, especially on the bamboos. Use the standard libinput functions to get to the libinput event instead, we don't care about the button numbers here anyway. Signed-off-by: Peter Hutterer <>
2018-03-05Introduce omnidirectional (elliptical) hysteresisDaniel van Vugt3-55/+71
This changes the hysteresis region to an ellipse (usually a circle), where previously it was a rectangle (usually square). Using an ellipse means the algorithm is no longer more sensitive in some directions than others. It is now omnidirectional, which solves a few problems: * Moving a finger in small circles now creates circles, not squares. * Moving a finger in a curve no longer snaps the cursor to vertical or horizontal lines. The cursor now follows a similar curve to the finger. Signed-off-by: Peter Hutterer <>
2018-03-05Merge branch 'wip/touchpad-maybe-end-state'Peter Hutterer5-29/+230
2018-03-02Fix Apple Magic Trackpad sensitivityMario Di Raimondo1-0/+2 Signed-off-by: Mario Di Raimondo <> Signed-off-by: Peter Hutterer <>
2018-03-02touchpad: add wobbling detectionKonstantin Kharlamov2-1/+59
The details are explained in comment in the code. That aside, I shall mention the check is so light, that it shouldn't influence CPU performance even a bit, and can blindly be kept always enabled. Bugzilla: Signed-off-by: Konstantin Kharlamov <> Signed-off-by: Peter Hutterer <> Reviewed-by: Konstantin Kharlamov <>
2018-03-01touchpad: remove the code for disabling hysteresisKonstantin Kharlamov1-20/+1
Signed-off-by: Konstantin Kharlamov <> Signed-off-by: Peter Hutterer <> Reviewed-by: Konstantin Kharlamov <>
2018-03-01touchpad: move the hysteresis into its own substructPeter Hutterer2-6/+8
Prep work for the wobbling detection patch Signed-off-by: Peter Hutterer <> Reviewed-by: Konstantin Kharlamov <>
2018-03-01tools: remove a stray perror() in libinput-recordPeter Hutterer1-1/+0
Signed-off-by: Peter Hutterer <>
2018-03-01tools: fix two scan-build errors in libinput-recordPeter Hutterer1-2/+1
division by 0 and an unused variable Signed-off-by: Peter Hutterer <>
2018-03-01touchpad: add a TOUCH_MAYBE_END statePeter Hutterer4-23/+154
This state is used by the pre-processing of the touch states to indicate that the touch point has ended and is changed to TOUCH_END as soon as that pre-processing is finished. Sometimes we have to resurrect a touch point that has physically or logically ended but needs to be kept around to keep the BTN_TOOL_* fake finger count happy. Particularly on Synaptics touchpads, where a BTN_TOOL_TRIPLETAP can cause a touch point to end (i.e. 1 touch down + TRIPLETAP) but that touch restarts in the next sequence. We had a quirk for this in place already, but if we end the touch and then re-instate it with tp_begin_touch(), we may lose some information about thumb/palm/etc. states that touch already had. As a result, the state machines can get confused and a touch that was previously ignored as thumb suddenly isn't one anymore and triggers assertions. The specific sequence in bug 10528 is: * touch T1 down * touch T2 down, detected as speed-based thumb, tap state machine ignores it * frame F: TRIPLETAP down, touch T2 up * frame F+1: touch T2 down in next frame, but without the thumb bit * frame F+n: touch T2 ends, tap state machine gets confused because that touch should not trigger a release Signed-off-by: Peter Hutterer <>
2018-03-01touchpad: don't end below-threshold pressure touches if nfake_fingers > nslotsPeter Hutterer2-2/+13
If we have more BTN_TOOL_*TAP fingers down than we have slots, ignore any below-threshold pressure changes on the slots. When a touchpad only detects two touches, guessing whether the third touch has sufficient pressure is unreliable. Instead, always assume that all touches have sufficient pressure when we exceed the slot number. Exception: if all real fingers are below the pressure threshold, the fake fingers are ignored too. Related to Signed-off-by: Peter Hutterer <>
2018-03-01touchpad: add the pressure thresholds to the debugging outputPeter Hutterer1-1/+3
Signed-off-by: Peter Hutterer <>
2018-03-01test: don't run the 2fg pressure test on single-touch touchpadsPeter Hutterer1-1/+1
Only the appletouch has pressure and thus executed that code path Signed-off-by: Peter Hutterer <>
2018-03-01test: don't run the MT pressure test on devices without MT pressurePeter Hutterer1-3/+60
This test worked because on devices that don't use pressure the touches were reset when BTN_TOUCH when to 0, triggering the 'ignore fake fingers when no real fingers are down' behavior. But this is a different code path than the pressure handling, so let's separate those tests. Signed-off-by: Peter Hutterer <>
2018-03-01doc: more references to libinput-recordPeter Hutterer3-9/+15
Signed-off-by: Peter Hutterer <>
2018-03-01tools: add --all to libinput-recordPeter Hutterer2-2/+77
Signed-off-by: Peter Hutterer <>
2018-03-01doc: add a section to the tools page for record/replayPeter Hutterer1-0/+94
Signed-off-by: Peter Hutterer <>
2018-03-01tools: add a libinput-replay toolPeter Hutterer3-0/+228
Similar in style to evemu-play but parses the YAML printed by libinput-record. Note that this tool requires python-libevdev which is a new package and may not be packaged by your distribution. Install with pip3 or alternatively, just ignore libinput-replay, it's a developer tool only anyway. User-visible differences to evemu-play: * supports replaying multiple devices at the same time. * no replaying on a specific device, we can add this if we ever need it * --verbose prints the event to stdout as we are replaying them. This is particularly useful on long recordings - once the bug occurs we can ctrl+c and match up the last few lines with the recordings file. This allows us to e.g. drop the rest of the file. Signed-off-by: Peter Hutterer <>
2018-03-01tools: add a libinput-record toolPeter Hutterer4-0/+1240
This is a tool that does effectively the same job as evemu-record. evemu has two disadvantages: its API is clunky and hard to extend even for simple features. And it has a custom file format that requires special processing but is difficult to extend and hard to write manually. e.g. the bitmasks require keeping a line number state to know which bit an entry refers to. libinput-record records the same data but the output is YAML. That can be processed easier and extended in the future without breaking the parsing. We can (in the future) also interleave the evemu output with libinput's debug output, thus having a single file where the events can be compared and analysed without the need for replaying. Likewise, we can easily annotate the file with parsable bits of information without having to shove all that into a comment (like version numbers of libinput, kernel, etc). User-visible differences to evemu-record: * the output file requires an explicit -o or --output-file argument * no evemu-describe equivalent, if you just want the description simply cancel before any events are sent * to see key codes, a --show-keycodes flag must be supplied, otherwise all 'normal' keys end up as KEY_A. This protects against inadvertent information leakage * supports a --multiple option to record multiple devices simultaneously. All recordings have the same time offset, it is thus possible to reproduce bugs that depend on the interaction of more than one device. And to answer the question of: why a printf-approach to writing out yaml instead of a library, it's simply that we want to be able to have real-time output of the recording. Signed-off-by: Peter Hutterer <>
2018-03-01touchpad: don't do speed-based thumb detection on single-touch or semi-mtsPeter Hutterer1-0/+4
Because life is too short for this Signed-off-by: Peter Hutterer <>
2018-02-28test: fix an incomplete commentPeter Hutterer1-1/+2
Signed-off-by: Peter Hutterer <> bump to 1.10.900Peter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <>
2018-02-27tools: fix inverse up/down threshold handling in measure touch-sizePeter Hutterer1-1/+1 Signed-off-by: Peter Hutterer <>
2018-02-27udev: fix flake8-3 complaint in parse_hwdb.pyPeter Hutterer1-0/+1
Signed-off-by: Peter Hutterer <>
2018-02-27Whitespace fixPeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <>
2018-02-26indentation: add .dir-locals.el for emacsKonstantin Kharlamov1-0/+4
It's pretty basic as compared to e.g. one of Mesa, but I don't see what else could be needed, and if anything, it can be added later. Signed-off-by: Konstantin Kharlamov <> Signed-off-by: Peter Hutterer <>
2018-02-26tools: fix option parsing in libinput measurePeter Hutterer1-1/+1
Missing '+' in the optstring caused it to evaluate all options. If any argument was passed to a subcommand, libinput-measure would throw an error and exit. Signed-off-by: Peter Hutterer <>
2018-02-26tools: remove pressure copy/paste leftovers from measure touch-sizePeter Hutterer1-11/+1
Signed-off-by: Peter Hutterer <>
2018-02-23evdev: remove excessive debugging outputPeter Hutterer1-1/+1
Accidentally committed in 2a378beab032d74277 Signed-off-by: Peter Hutterer <>
2018-02-21touchpad: delay arbitration by 90ms after touch togglePeter Hutterer6-7/+150
When drawing on a tablet, the hand usually rests on the device, causing touch events. The kernel arbitrates for us in most cases, so we get a touch up and no events while the stylus is in proximity. When lifting the hand off in a natural position, the hand still touches the device when the pen goes out of proximity. This is 'immediately' followed by the hand lifting off the device. When kernel pen/touch arbitration is active, the pen proximity out causes a touch begin for the hand still on the pad. This is followed by a touch up when the hand lifts which happens to look exactly like a tap-to-click. Fix this by delaying the 'arbitration is now off' toggle, causing any touch that starts immediately after proximity out to be detected as palm and ignored for its lifetime. Signed-off-by: Peter Hutterer <>
2018-02-21evdev: pass the time down to toggle_touchPeter Hutterer4-9/+18
Currently unused, will be used in later patches Signed-off-by: Peter Hutterer <>
2018-02-21touchpad: change the stylus palm arbitration to process touchesPeter Hutterer2-10/+25
Previously, on touch toggle (invoked by the tablet when a pen goes in proximity) the touchpad cleared the state and ignored any events. Since we ignore touches that we didn't see the touch begin for, this handled the cases of a touch remaining after proximity out. This code pre-dates palm detection, so let's take the bluetack off and instead integrate it with proper palm detectino.
2018-02-21touchpad: reset the palm state to NONE on a new touchPeter Hutterer1-0/+1
Signed-off-by: Peter Hutterer <>
2018-02-21meson: add the 221 version to the libsystemd dependencyPeter Hutterer1-1/+1
The sd-bus interface we're using wasn't public until 221. Signed-off-by: Peter Hutterer <>
2018-02-20touchpad: only begin fake touches when we have at least one finger downPeter Hutterer3-7/+53
If a single-touch touchpad drops below the pressure threshold in the same frame where a fake finger is added, we begin a fake touch here. The subsequent loop ends this fake touch because real_fingers_down is 0. This causes the tapping code to have a mismatch of how many fingers are down because it never sees the touch begin event for that finger.
2018-02-20test: send major/minor for the wacom intous 5 finger devicePeter Hutterer1-0/+22
Signed-off-by: Peter Hutterer <>
2018-02-20touchpad: add a touch index for debuggingPeter Hutterer6-31/+54
Makes debugging a bit easier when you know *which* touch was marked as palm, etc. Signed-off-by: Peter Hutterer <>
2018-02-20touchpad: compress a statementPeter Hutterer1-4/+2
Having this initialized and then changed later is more confusing that having the trinary here in one line
2018-02-20libinput-measure-touchpad-tap: use /usr/bin/env to invoke python3Maxin B. John1-1/+1
Tweak this python scripts to use '/usr/bin/env python3' Signed-off-by: Maxin B. John <> Signed-off-by: Peter Hutterer <>
2018-02-16udev: fix segfault when resuming before assigning a seatPeter Hutterer2-1/+44
Signed-off-by: Peter Hutterer <>
2018-02-16Don't leak when realloc failsPeter Hutterer1-2/+6
Found by coverity Signed-off-by: Peter Hutterer <>
2018-02-16Silence coverity warning about uninitialized entryPeter Hutterer2-2/+2
Signed-off-by: Peter Hutterer <>