Commit Graph

269 Commits

Author SHA1 Message Date
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
Martin Kepplinger
8772a593b4 Fix config comment description to match the config
Since the config matches on tablets too, update the describing comment
accordingly.

Signed-off-by: Martin Kepplinger <martin.kepplinger@ginzinger.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-08 10:33:58 +10:00
Peter Hutterer
a80773a488 xf86-input-libinput 0.25.1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
xf86-input-libinput-0.25.1
2017-05-05 13:43:23 +10:00
Peter Hutterer
8bc694595d Post a motion event after proximity events
This patch splits the meat of xf86libinput_handle_tablet_axis into a helper
function xf86libinput_post_tablet_motion(), to be called right after we send
the proximity in event.

Clients that don't handle proximity (e.g. all XI2 clients) don't see the
coordinates we send along with the proximity events. And, for historical
reasons, they may not look at the coordinates in button events. So a device
that comes into proximity and immediately sends a tip down button event
doesn't send a motion event, causing the client to think the tip down was at
whatever the last known position was (before previous prox-out).

The practical effect is that when a user tries to draw a few dots, they end up
being connected to each other.

https://bugzilla.redhat.com/show_bug.cgi?id=1433755

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-22 11:14:15 +10:00
Peter Hutterer
153a7fc62f xf86-input-libinput 0.25.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
xf86-input-libinput-0.25.0
2017-03-09 15:58:39 +10:00
Peter Hutterer
72fb6d304e test: fix a test failure on ppc64(le) and aarch64
Caused by different results in -O0 vs -O2. The resulting array differs only
slightly but the initial sequence has one extra zero. That triggers our
assert, no other compiler flag seem to be affecting this.

Compiled with -O0:
Breakpoint 1, test_nonzero_x_linear () at test-bezier.c:157
157			assert(bezier[x] > bezier[x-1]);
(gdb) p bezier
$6 = {0 <repeats 409 times>, 1, 2, 4, 5, 7, 9, 10, 12, 14, 15, 17, 19, 21, 22,

Compiled with -O2:
(gdb) p bezier
$1 = {0 <repeats 410 times>, 1, 3, 5, 7, 9, 10, 12, 14, 15, 17, 19, 20, 22,

Printing of the temporary numbers in the decasteljau function shows that a few
of them are off by one, e.g.
    408.530612/0.836735 with O0, but
    409.510204/0.836735 with O2
Note: these are not rounding errors caused by the code, the cast to int
happens afterwards.

Hack around this by allowing for one extra zero before we check that the rest
of the curve is ascending again.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-28 15:27:33 +10:00
Peter Hutterer
aae2c8ad9a Open sysfs files directly instead of going through the server
Only use-case here are pad mode LEDs that now live in /sys/class/leds. Asking
the server to open them is pointless, the server only knows how to open Option
"Device". And since the LEDs are in sysfs we should have access to them
anyway, so no need for jumping through or hula-ing hoops.

xf86CloseSerial() works as intended as it's a slim wrapper around close(), so
we only have to worry about the open() path here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-27 09:34:36 +10:00