Commit Graph

275 Commits

Author SHA1 Message Date
Peter Hutterer
2bbc4727a1 Switch to the real MIT license
Due to a copy/paste error, the COPYING file and subsequently created files
with the same content referred to the "Historical Permission Notice and
Disclaimer - sell variant", not the proper MIT license.

Replace with the proper MIT (Expat) license and add the use SPDX license
identifiers.

Acks below are from contributors with substantial changes, collected in MR !19
or via private email correspondence.

https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/-/merge_requests/19

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Dorian Stoll <dorian.stoll@tmsp.io>
Acked-by: Jonas Ådahl <jadahl@gmail.com>
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Acked-by: Evangelos Foutras <evangelos@foutrelis.com>
Acked-by: Niklas Haas <git@haasn.xyz>
Acked-by: Olivier Fourdan <ofourdan@redhat.com>
Acked-by: David Rosca <nowrep@gmail.com>
Acked-by: Lyude Paul <lyude@redhat.com>
Acked-by: Keith Packard <keithp@keithp.com>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Michel Dänzer <michel@daenzer.net>
Acked-by: Tim Writer <tim.writer@amd.com>
Acked-by: Friedrich Schöller <code@schoeller.se>
Acked-by: Mikhail Konev <k.mvc@ya.ru>
Acked-by: Martin Pieuchot <mpi@openbsd.org>
2021-03-24 13:28:56 +10:00
Dorian Stoll
39be944991 Lift canceled touch inputs
If a touch input gets turned into a palm (by setting ABS_MT_TOOL_TYPE to
MT_TOOL_PALM), libinput will emit a cancel event instead of the normal
up event. The xorg wrapper needs to be able to handle a canceled touch
and lift it, otherwise these inputs will never get lifted and will stick
around forever.

Signed-off-by: Dorian Stoll <dorian.stoll@tmsp.io>
2020-11-04 23:53:01 +01:00
Povilas Kanapickas
bd2aaa246d Remove extraneous semicolon 2020-10-19 21:09:49 +03:00
Povilas Kanapickas
99773d7bda Remove unused btnmap variables 2020-10-19 21:07:47 +03:00
Peter Hutterer
3afb6244e3 Bump the server requirement to 1.19 to get rid of a bunch of ifdefs
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-05-19 16:34:18 +10:00
Peter Hutterer
f279108ffd Bump the libinput requirement to 1.11
Released June 2018, that should be recent enough.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-05-19 16:30:35 +10:00
Peter Hutterer
583ed5acdc xf86-input-libinput 0.30.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
xf86-input-libinput-0.30.0
2020-05-19 15:58:13 +10:00
Peter Hutterer
e8e5d1a6b5 gitlab CI: update to latest CI templates
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-05-19 15:58:13 +10:00
Peter Hutterer
639b21d78a gitlab CI: bump to Fedora 32
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-05-19 15:47:11 +10:00
Peter Hutterer
e52daf203b Implement support for scroll button locks
Add a boolean option/property to enable/disable the scroll button lock. Where
enabled, the button can be clicked and released as opposed to having to be
held down.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-10-11 11:18:52 +10:00
Peter Hutterer
400bf493d1 xf86-input-libinput 0.29.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
xf86-input-libinput-0.29.0
2019-08-12 12:35:51 +10:00
Peter Hutterer
27a88897be Add basic Gitlab CI for testing the build
This merely tests against the devel package in Fedora, not against the xserver
from git. Should be enough, the driver here doesn't change enough to need the
git builds.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-12 11:44:56 +10:00
Peter Hutterer
d5867e5db6 Fix compiler warning about unhandled switch events
This bumps the required libinput version to 1.7 - which has been out for over
two years now. That's conservative enough.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-12 10:36:08 +10:00
Peter Hutterer
1ef2ed874e Check for the tool type too when creating subdevices
Fixed #25

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-31 00:32:44 +00:00
Peter Hutterer
3c9052d886 Fix wrong enum type
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-31 00:32:44 +00:00
Peter Hutterer
39b0bb4585 Revert "Upgrade the default scroll distance to 120"
This was part of the high-resolution wheel work that was factored out ahead of
time. Problem is: this breaks scroll button emulation in the server as we
use the distance to determine when we click buttons 4-7.

Before: movement of 15 normalized pixel units on a touchpad - one click. Now:
120 of those units. So that's a bit less than ideal.

The change to 120 can be done, but needs the corresponding handling in the
axis distance calculations.

Fixes #24

This reverts commit 055481187d.
2019-07-30 11:51:12 +10:00
David Rosca
8923d18d25 Also use type to match tablet tool with device
On devices with tools having both serial and id 0,
it would fail to create separate subdevices.

Thinkpad X220T (Wacom ISDv4 E6) now correctly registers
Pen and Eraser xinput devices.
2019-02-25 18:43:42 +01:00
Peter Hutterer
055481187d Upgrade the default scroll distance to 120
This is just a number, to be used as divider and shouldn't have any effect in
correctly written clients. With the high-res scrolling coming up however, we
have a few devices where the dist cannot be expressed as an integer fraction
of 15, so let's up it to 120 because we know all hardware wheels have to be an
integer fraction of that that, thanks to Microsoft's API requirements.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-02-12 15:40:53 +10:00
Peter Hutterer
5a925eaa84 xf86-input-libinput 0.28.2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
xf86-input-libinput-0.28.2
2019-02-04 13:14:11 +10:00
Peter Hutterer
e7eafa199e Handle scroll wheel events with a discrete of 0
The driver currently assumes that any wheel event has a non-zero discrete
value of 1. This is incorrect, it just hasn't triggered yet with any device.

With the hi-res scroll patches in place in the kernel and libinput, we may get
wheel events with a discrete value of 0. We assume that if this ever happens,
the device has some sensible click angle set so all we need to do is ignore
the discrete 0 events and wait for the first discrete event to come.

Also add an explanatory comment too to make it clear the calculation is only
done once.

Fixes #19

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-01-25 14:31:11 +10:00
Peter Hutterer
d13ab268bd Return the wheel scroll value instead of just the fraction
This is prep work for the hi-res work but right now, no real functional
changes. It does however fix a bug where we used the vertial scroll dist for
the horizontal wheel as well.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-01-24 08:29:48 +10:00
Peter Hutterer
347c78387e Split the scroll axis details up for easier extension
If we need more per-axis fields, it's easier to add this way.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-01-21 13:08:30 +10:00
Peter Hutterer
b63f7994dc conf: add an example snippet for how to assign options
Users still like to copy the whole file, potentially messing things up.
Let's put a warning into the file directly that this is less than ideal.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-01-07 16:29:51 +10:00
Alan Coopersmith
04f42d6e0f Update configure.ac bug URL for gitlab migration
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-11-25 12:47:32 -08:00
Alan Coopersmith
5d341d1d6c Update README for gitlab migration
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-11-18 11:48:07 -08:00
Peter Hutterer
4985de5ef3 Remove two dead assignments
Value stored but never read.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-10-15 15:30:55 +10:00
Peter Hutterer
e26fc3c66c xf86-input-libinput 0.28.1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
xf86-input-libinput-0.28.1
2018-10-15 09:36:36 +10:00
Peter Hutterer
a759610292 Use the seat slot, not the device slot for touch events
The device slot is per-device, so if we have more than one device we may get a
touch down event for a slot already in use.

Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/153

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-10-04 11:47:46 +10:00
Peter Hutterer
21ff2ca7d1 Remove unused assignment
dev is our list iterator below, this is a dead assignment

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-19 15:58:06 +10:00
Peter Hutterer
c67f191d5b xf86-input-libinput 0.28.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
xf86-input-libinput-0.28.0
2018-07-11 11:06:59 +10:00
Peter Hutterer
1978a2555b Minor whitespace fix
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-11 10:59:20 +10:00
Peter Hutterer
0909a1a765 draglock: fix memory overwrite during draglock parsing
Passing in the size of the array but using it as "number of elements" inside
the function. Rename a bunch of arguments to avoid this.

https://bugs.freedesktop.org/show_bug.cgi?id=107166

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-10 11:17:50 +10:00
Peter Hutterer
20bb8d6b9f Revert "Implement the custom acceleration curve options"
Custom pointer acceleration curves were reverted in libinput, so no point
having this code here.

This reverts commit d84e0035d1.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-23 08:14:23 +10:00
Peter Hutterer
1e88664d95 Use the libinput touch count to init the right number of touches
Initial version by Johannes Pointner <h4nn35.work@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-02 13:59:00 +10:00
Peter Hutterer
d84e0035d1 Implement the custom acceleration curve options
One new property, and the existing accel profile gets extended to keep one
extra value. The new property libinput Accel Curve Points is a list of pairs
of points to be added to the acceleration curve.

libinput only supports adding points to the curve so we simply declare the
behavior as undefined when the curve is set multiple times. Also helps to
identify those that bother to read the man page before playing with random
driver values.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-20 14:04:25 +10:00
Peter Hutterer
6c75acfcdf Use xf86SetStrOption to check for string options
This one shows up in the log and marks it as used.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-20 13:34:23 +10:00
Peter Hutterer
eaf847be16 man: whitespace fixes in man page
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-17 15:11:12 +10:00
Peter Hutterer
d319092d55 man: fix formatting issue caused by invalid tag
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-17 13:52:33 +10:00
Peter Hutterer
18cc042e68 xf86-input-libinput 0.27.1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
xf86-input-libinput-0.27.1
2018-04-10 09:19:52 +10:00
Evangelos Foutras
0db82219bb Fix "left handed" property not set on all pointers
Remove conditional that prevents the LIBINPUT_PROP_LEFT_HANDED{,DEFAULT}
properties from being set on all pointer devices (only the first got it).
This appears to be a debugging left-over accidentally merged in
6d3bd4544a.

https://bugs.freedesktop.org/show_bug.cgi?id=105667

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-03-22 10:59:01 +10:00
Peter Hutterer
f93bc148d4 xf86-input-libinput 0.27.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
xf86-input-libinput-0.27.0
2018-03-20 11:23:57 +10:00
Peter Hutterer
0d4b50fd6e man: note that we don't do /dev/input/by-id or /dev/input/by-path
For logind-setups we need to match the path libinput wants to open with the
Option Device path that the device has so we know when to return the
server-fd. This doesn't work for by-id or by-path because libinput resolves
those (through udev) to the actual eventX node so our paths look different
when they are the same device.

This could be fixed but since this is easy enough to work around with a
InputClass section and rather a niche case, it's not really worth the effort.

https://bugs.freedesktop.org/show_bug.cgi?id=105562

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-20 10:48:04 +10:00
Peter Hutterer
9d9f59fd4c Apply the capabilities checks on subdevices when applying the config
Properties are initialized on the correct devices only but on resume we'd just
blindly apply the config from our device. Depending on the resume order, this
would mean we'd apply a previously set config with a default config.

Example:
* pointer device with keyboard subdevice
* pointer device exports natural scrolling, keyboard device does not and
  remains at default (off)
* client enables natural scrolling on the pointer device
* VT switch away, VT switch back
* pointer device gets enabled first, enables natural scrolling on the
  libinput device
* keyboard device gets enabled second, resets to the default value

Reported-by: Yuxuan Shui <yshuiv7@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-02-21 09:53:12 +10:00
Peter Hutterer
7353481490 Split LibinputDeviceApplyConfig into helper functions
No functional changes
2018-02-02 14:25:44 +10:00
Peter Hutterer
6d3bd4544a Move the subdevice capabilities check into the properties
87f9fe3a6fafe60134c6's intention was to not create properties that a subdevice
doesn't have configuration options for (i.e. if you have a pointer+keyboard
device, don't expose tapping configuration on the keyboard subdevice).

The result was messy, the checker function had a confusing triple-negation and
some properties weren't checked - e.g. left-handed was allowed for touch/tablet
but not for pointer, dwt was allowed for any device.

Fix this by moving the check into the property init function directly and
inverting the helper function to be easier to read.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-02-02 14:25:31 +10:00
Peter Hutterer
2be6487de4 xf86-input-libinput 0.26.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
xf86-input-libinput-0.26.0
2017-09-15 11:26:54 +10:00
Peter Hutterer
6ce3d0249d Post a motion event before a tablet button down
Not all clients update the pointer position correctly from the button events
(for historical reasons) so we need to send a motion event before the button
event that represents a tip state change.

https://bugs.freedesktop.org/show_bug.cgi?id=101588

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-17 15:20:29 +10:00
Peter Hutterer
87f9fe3a6f Only initialize properties that match capabilities on a subdevice
If a device is split into multiple subdevices, usually pointer+keyboard, we
initialized properties matching the libinput device on both devices. This
results in the keyboard having e.g. a Accel Speed or Left Handed settings even
though it cannot send any events of that type.

Filter by capabilities on the subdevice so we only get those properties that
match the subdevice's capabilities.

https://bugs.freedesktop.org/show_bug.cgi?id=100900

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-29 08:15:20 +10:00
Peter Hutterer
0c657e0dcf Update copyright years
because why not

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-18 14:03:06 +10:00
Niklas Haas
ac3574958f man: add missing documentation for Accel Profile
This seems to have been simply missing from 0163482e.

cf. https://bugs.freedesktop.org/show_bug.cgi?id=101017

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-15 11:41:46 +10:00