xf86libinput.c:2457:89: warning: passing argument 1 of
‘libinput_event_pointer_get_axis_source’ from incompatible
pointer type [-Wincompatible-pointer-types]
No function changes due to the binary layout of libinput events but
let's not rely on that.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
xf86CheckStrOption returns the same value but doesn't mark it as used in
the server and, more importantly, doesn't spam the log with
(**) Option "_source" "server/udev"
messages.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Starting on libinput 1.19 pointer axis events have been deprecated in
favor of their scroll equivalents, including support for high-resolution
wheel scroll.
While it is recommended to handle the new events, some applications
and/or frameworks might not be ready at the moment.
Provide an option to discard high-resolution wheel scroll events.
Fix#41
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Where libinput supports high-resolution scroll events, the scroll source
is encoded in the event type.
Get the scroll source in xf86libinput_handle_event to facilitate the
migration.
Refactor, no functional changes.
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
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.
For non-wheel scrolls we need to now map into the new range. Previously we
just passed the scroll events on from the touchpad/button scrolling, meaning a
vdist of 15 meant 15 "libinput pixels" of scrolling resulted in a logical
wheel click. Now that we have 120 as vdist, we need to times the input data by
8 to keep the same proportions.
See 39b0bb4585 for the previous revert.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
To be used for touchpads and continuous (i.e. button-based scrolling).
libinput provides us with pixel data for finger-based and button-based
scrolling but the X server does support this - XI2.1 smooth scrolling is
merely centered around a logical scroll click (defined as "increment"), with
smooth scrolling being a fraction of that increment. For example, in the old
synaptics driver that value was in device-specific units and thus different
for every device.
The increment is a constant value set in the ScrollClass and cannot be changed
at device runtime. So we simply initialize with a random default (15, because
that works well for wheels) and then scale our pixel delta in to that range.
With the default value, a 15 pixel movement would result in a logical scroll
click, if the distance is set to 30 the users has to move 30 pixels to trigger
that scroll click. Pixel here being defined as the deltas that libinput
provides to us.
From the client's perspective nothing changes, the increment is still the
same.
Range checks are quite restrictive, this option is supposed to improve
usability, not as a workaround around other bugs.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
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>
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>
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>
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>
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.
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.
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>
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>
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>
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>