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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Right now for touch arbitration to work, we require the device group to
be the same (i.e. they're hanging off the same physical bus). That's not
always the case and statistically we have a lot more devices that have
a built-in tablet + touchscreen than we have Intuos-like external
tablets.
So let's default to the more common case - enabling arbitration with the
first touchscreen/external touchpad we find. If a subsequent device is
"better", swap it out. Right now, the only heuristic we have here is the
device group check but in the future we could get more precise.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The key_count array for buttons records the logical button sent to the
client - for left-handed configurations that means a BTN_LEFT is
recorded as BTN_RIGHT.
When the device is suspended and we are releasing all keys we must thus
release the button code as-is without trying to map it again.
Fixes#881
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This version includes the (possible) fix for our CI picking up the wrong
range in the commit checks and failing the pipeline.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
A whitespace fix, moving a check-related #define closer to the #include
and change a test that doesn't need a device to litest_add_no_device().
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Like in libinput_device_switch_has_switch()'s documentation, document
the error case in libinput_device_tablet_pad_get_num_buttons(),
libinput_device_tablet_pad_get_num_rings() and
libinput_device_tablet_pad_get_num_strips().
Signed-off-by: José Expósito <jose.exposito89@gmail.com>