Commit graph

4881 commits

Author SHA1 Message Date
Peter Hutterer
d75a0fa42d tablet: fix the tilt range being off by one
Kernel ranges are inclusiv min/max, so let's make sure we calculate that
correctly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-08-29 17:07:38 +00:00
Peter Hutterer
65eaabf91f tools/record: print the vid/pid with proper 4 hex digits
The field with includes the 0x if printing with "0x04d". And because
that format prints zero as just 0000, let's move the 0x prefix out and
let printf only handle the actual number.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-08-29 05:35:15 +10:00
Peter Hutterer
1680f2fbaa libinput 1.24.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-08-25 13:04:17 +10:00
Bjørn Forsman
34b9c4ce44 quirks: Add Wacom Bamboo Fun Pen
We must disable ABS_DISTANCE or else the automatic pressure offset
calculation doesn't work for this device.

Signed-off-by: Bjørn Forsman <bjorn.forsman@gmail.com>
2023-08-24 19:22:00 +02:00
Bjørn Forsman
3dba00845c tablet: increase pressure offset limit from 20% to 50%
detect_pressure_offset() currently rejects offsets that are greater than
20%. My graphics tablet (Wacom Bamboo Fun) is about 30%. The pen tip is
2 mm. Wacom recommends replacing at 1 mm, which means this isn't worn
out yet and we should instead increase the limit to make these devices
usable.

Without this change a "pen down" event happens simultaneously with the
pen being detected -- about 1 cm above the surface -- and producing
libinput pressure of about 0.30. This means you start drawing "in the
air", without knowing up front where the cursor is going to be.

Signed-off-by: Bjørn Forsman <bjorn.forsman@gmail.com>
2023-08-24 08:04:03 +02:00
Yinon Burgansky
f259cac9ca docs: improve custom pointer acceleration documentation.
- Explain calculation made by the driver.
- Provide detailed example with a plot for a custom function.
- Fix inaccurate explanation of unit values.

Signed-off-by: Yinon Burgansky <yinonburgansky@gmail.com>
2023-08-16 20:13:39 +03:00
Peter Hutterer
5534a5f640 quirks: add quirk for the RazerBlade152023 keyboard
Autogenerated from our razer-quirks-lister.py tool

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-08-08 20:26:28 +03:00
José Expósito
08e4a3deb9 quirks: Add Lenovo Legion 7i 4090 keyboard quirks
Disable while typing is not working because the keyboard uses the USB
bus.

Add the `AttrKeyboardIntegration=internal` quirk to fix it.

Fixes https://gitlab.freedesktop.org/libinput/libinput/-/issues/911
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2023-07-31 17:16:42 +02:00
José Expósito
fa0d27d175 quirks: AddHP Spectre x360 15 ModelTabletModeNoSuspend keyboard quirk
The HP stream x360's embedded-controller filters out events form its
builtin keyboard when in tablet-mode itself; and it has a volume up/down
on the side.

Do not suspend the keyboard when in tablet-mode so that the volume
up/down button keeps working when in tablet-mode.

Add a ModelTabletModeNoSuspend quirk so that the home button keeps
working when in tablet-mode.
This can safely be done since the rest of the keyboard gets disabled by
the embedded-controller for us.

Fixes https://gitlab.freedesktop.org/libinput/libinput/-/issues/920
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2023-07-31 13:25:57 +02:00
Llerraf Gnem
38fdfd1dfe
docs: fix "See also" link in libinput_config_accel_profile
Used to be to libinput_device_config_accel_set_points, corrected to
libinput_config_accel_set_points
2023-07-26 11:41:34 -05:00
Peter Hutterer
f617b414fb Drop the Signed-off-by requirement
We've had this for roughly 10y now and it's value is dubious. Most of
xorg no longer requires, mesa accepts but doesn't require it, most of GNOME
doesn't accept it and neither does systemd.

Let's drop the requirement.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-07-21 09:08:46 +10:00
Peter Hutterer
35a237e24c Fix a few gcc analyzer complaints in util-strings.*
Sprinkle a few asserts into the various string helpers for where our
arguments must not be NULL.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-07-19 14:19:08 +10:00
Peter Hutterer
2ebb6f629f Fix a gcc analyzer complaint
Doesn't trigger here since we never call it with NULL but let's make
sure anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-07-18 16:05:13 +10:00
Peter Hutterer
3fb876a49d test: expand the tablet mode switch test to check for fake key releases
If a key is still down when the tablet mode switch goes on, make sure we
release the key before the switch goes in effect.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-07-17 09:32:24 +10:00
Peter Hutterer
9bd0604ea3 Add a triage policy for kernel bugs
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-07-04 13:52:44 +10:00
Peter Hutterer
51875324e0 Add triage policies for merge requests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-07-04 12:14:12 +10:00
Peter Hutterer
b39145e468 doc/user: quirks are available, not supported
This is a bit nitpicky but let's call the current quirks merely
"available" rather than "supported" since quirks should never be seen as
supported API.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-06-29 03:32:05 +00:00
Peter Hutterer
a244b9e32b tablet: apply pressure offset handling for non-distance tablets
Previously we only applied pressure offset handling for tablets that
supported ABS_DISTANCE. Detecting a pressure offset when the tool
doesn't actually touch the surface is easy after all.

But tablets without distance handling may also have a pressure offset,
so let's try to detect this. This is obviously harder since the pen will
always touch the tablet's surface whenever it is in proximity and thus
will always have *some* pressure applied to it.

The process here is to merely observe the minimum pressure value during
the first two strokes of the pen. On the third prox in, that minimum
pressure value is taken as the offset. If the pressure drops below the
offset, the offset is adjusted downwards [1] so over time we'll
get closer to the pen's real offset.

[1] this is already done for distance tablets too

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-06-23 05:21:51 +00:00
Peter Hutterer
ecf02deb17 tablet: split proximity and axis update handling
Let's make this two conditions, this is too confusing to read otherwise.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-06-23 05:21:51 +00:00
Peter Hutterer
eea10aef47 tablet: split detecting and updating the pressure offset
detect_pressure_offset() would previously update an existing offset but
otherwise skip most of the work for any event other than proximity-in
events. This was too hidden, let's split this into two functions - one
to update an existing offset and another one to detect a new offset.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-06-23 05:21:51 +00:00
Peter Hutterer
71f5dc6e23 tablet: move setting the pressure offset into a helper function
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-06-23 05:21:51 +00:00
Peter Hutterer
a88d107c0d doc/user: update the udev rule to handle bind/unbind events
Summary: we expect add, change or remove but kernel 4.12 added bind and
unbind. These events were previously discarded by udevd. Our rules should
handle any event *but* remove, so update as suggested in the announce email
linked below.

For a longer explanation, see the system 247rc2 announcement
https://lists.freedesktop.org/archives/systemd-devel/2020-November/045570.ht

See cd37dcfa66 where we did this already
for the udev rules we use ourselves.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-06-15 03:31:30 +00:00
Peter Hutterer
6f10f01af2 test: check that the pressure offset is reduced during motion events too
Ensure that if we do get pressure < offset that that offset is reduced
to the current pressure value.

The implementation for this is arguably buggy, reducing the pressure
means we get a tip up event since we now reach 0% of pressure. Arguably
we should enforce the tip staying down and releasing it later but since
this should typically never happen more than once per tool per context
and working around this is a lot of effort, we live with it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-06-14 10:46:24 +10:00
Peter Hutterer
24cf215f54 test: check the tablet pressure values with a helper function
Makes the code a bit easier to read. Adds precision to some tests,
slightly loosens precision in some other tests but that shouldn't matter
here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-06-13 15:24:43 +10:00
Peter Hutterer
684ac6b0c2 test: remove a confusing comment
We don't actually increase the pressure here, so let's not say we do

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-06-13 13:50:10 +10:00
Peter Hutterer
65c71fd6b4 doc/user: move ignoring devices to separate page
This is way too hidden to the point where i couldn't find it for quite a
while despite knowing it exists. Move it to an entry under
troubleshooting.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-06-12 13:50:25 +00:00
Peter Hutterer
d159799637 CODING_STYLE: drop the unintended real name policy
This was never intended as a true real name policy (and we never
actually interpreted it that way), its purpose is to identify users
and avoid commits from 12345@example.com.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-06-12 15:05:34 +10:00
Peter Hutterer
83144a0edc man: hide debug-gui from the libinput.man page if disabled
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-06-09 13:00:08 +10:00
Peter Hutterer
9a3429f4af test: add a calibrated (swapped) tablet device
Swap any input for both x/y and default to a calibration matrix that
swaps it back. In theory, that device will then behave as every other
device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-06-07 09:23:05 +10:00
Peter Hutterer
bc18b18e32 test: add a pre-calibrated flag and exclude the tests as necessary
Prep work for adding a precalibrated tablet.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-06-07 09:23:05 +10:00
Peter Hutterer
44de3ff367 test: add an extra override hook for tablet motion
Currently unused but it complements the existing override handlers.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-06-07 09:23:05 +10:00
Peter Hutterer
160b062454 test: change tablet coords to doubles and pass the pointer through
All other motion/touch/... coords are already doubles so let's follow
suite here. And passing a pointer into the custom handlers
means we can modify x/y slightly and return false, leaving the rest up
to the generic event handling code.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-06-07 09:23:05 +10:00
Peter Hutterer
4bdec007ba CI: add a comment to the meson build helper
We now have an upstream for it so we can sync changes between projects.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-05-30 15:17:14 +10:00
Simon Ser
57a2339779 doc/user/timestamps: document which clock is used
Document that all timestamps are given in the CLOCK_MONOTONIC
domain.

Signed-off-by: Simon Ser <contact@emersion.fr>
2023-05-09 11:18:23 +02:00
Peter Hutterer
d3481c8807 evdev: if a device's rotation is around 180 degrees, flip the wheel
For a device used upside-down, make sure the wheels correspond to the
new physical directions. There's a grace range of 20 degrees either way
since that seems like it makes sense.

For 90 degree rotation (or 270 degree) the wheel is left as-is, the
heuristics to guess what angle we want in this case is not clear enough.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-04-27 13:15:14 +10:00
Peter Hutterer
64af4beb6b fallback: remove write-only rotation.is_enabled variable
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-04-27 13:15:14 +10:00
Peter Hutterer
bee70901ec tools: add rotation support to debug-events and debug-gui
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-04-27 13:15:14 +10:00
Peter Hutterer
a328ada6ef test: carry the step as argument for arg testing
Simplifies things a bit since it makes it all more explicit

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-04-27 13:15:14 +10:00
Peter Hutterer
a9f4fdde0e CI: update to use Fedora 38
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-04-20 09:51:49 +10:00
Peter Hutterer
861f01928a tools/debug-gui: fix a deprecated warning
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-04-20 09:51:49 +10:00
Peter Hutterer
c1ab44c566 tools: fix a few scan-build dead store warnings
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-04-20 09:51:49 +10:00
Peter Hutterer
b4cf6e9baf CI: fix the rpm build job's Fedora version
We have the variable set, we just didn't use it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-04-20 09:04:57 +10:00
Peter Hutterer
8e34037dcd doc/user: add a section on natural scrolling
Just for completeness, turns out we were missing that one.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-04-18 16:54:57 +10:00
Peter Hutterer
7073a39ec0 doc/user: fix documentation for rotation
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-04-18 16:54:57 +10:00
Peter Hutterer
2432b6eeff tools: add a tool to update our Razer quirks for internal keyboards
openrazer keeps a convenient list of keyboard devices that belong to the
RazerBlade line and thus should be marked as internal by us. Let's
use that one.

This script git clones the current openrazer repo, imports the file we
need and then overwrites our current quirks file with the sorted list of
devices.

For the second part of this to work reliable we need a marker in the
quirks file that marks the start of autogenerated entries.

Heavily influenced by @danryu in !887.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-04-11 14:48:41 +10:00
Peter Hutterer
8a01c3423d quirks: sort the razer entries by PID
No functional changes here, this should help with adding autogenerated
entries since we no longer rely on the source order.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-04-11 14:43:46 +10:00
Robert Glossop
57f0354ee5 Disregard touchless clicks on flaky devices
Some touchpads, notably those on the Dell XPS 15 9500, are prone to registering
touchpad clicks when the case is sufficiently flexed. Ignore these by
disregarding any clicks that are registered without touchpad touch.

Signed-off-by: Rob Glossop <robgssp@gmail.com>
2023-04-11 02:00:52 +00:00
Peter Hutterer
7c84fb87e9 CI: remove unused meson-prep.sh and meson-test.sh scripts
From an earlier version of the b2c patches, before meson-build.sh got
updated to do what's required here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-04-11 00:13:08 +00:00
Hector Martin
4a8b5e6ec4 touchpad: Disable edge palm detection Apple touchpads
This hurts more than it helps, and users complain of dead trackpad
edges. Apple touchpads have fairly sophisticated internal palm rejection
algorithms going back many years, so let's just disable this one on
everything Apple.

Related to: #433 (need to figure out what other hardware may need this)

Signed-off-by: Hector Martin <marcan@marcan.st>
2023-04-06 16:34:20 +09:00
Hector Martin
d61d385951 evdev: Enable natural scrolling by default on Apple
As suggested by the comment itself. I think most users expect this.

Signed-off-by: Hector Martin <marcan@marcan.st>
2023-04-06 15:30:14 +09:00