Commit Graph

1511 Commits

Author SHA1 Message Date
Alan Coopersmith
dbc772982e Quiet -Wredundant-decls from xorg/os.h fallbacks for timingsafe_memcmp
The Xorg headers provide their own version of timingsafe_memcmp for
platforms that don't have them in libc yet, but rely on configure to
set HAVE_* defines to determine if they should be defined in the headers.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-synaptics/-/merge_requests/17>
2024-05-12 23:03:21 +00:00
Alan Coopersmith
e3f6c5c642 Fix -Wold-style-declaration warning
synaptics.c:143:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]
  143 | const static struct {
      | ^~~~~

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-synaptics/-/merge_requests/17>
2024-05-12 23:03:21 +00:00
Alan Coopersmith
d21c533fd5 Raise minimum supported Xserver version from 1.12 to 1.15
Drops support for ABI_XINPUT_VERSION < 20, including removing support
for driver-side coordinate scaling, since the X server handles it now.

Xserver 1.15 was released in Dec. 2013.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-05-12 14:27:20 -07:00
Alan Coopersmith
46d0532962 Handle a -Wstrict-prototypes/-Wold-style-definition pair of warnings
synclient.c:196:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
  196 | dp_init()
      | ^~~~~~~
synclient.c: In function ‘dp_init’:
synclient.c:196:1: warning: old-style function definition [-Wold-style-definition]

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-01-05 17:10:41 -08:00
Alan Coopersmith
a9bf2939f0 Handle 5 -Wmissing-prototypes warnings
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-01-05 17:08:13 -08:00
Alan Coopersmith
f52912d062 Fix 185 -Wdiscarded-qualifiers warnings
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-01-05 17:01:50 -08:00
Alan Coopersmith
13a26918d8 Add X.Org's standard C warning flags to AM_CFLAGS
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-01-05 16:55:03 -08:00
Alan Coopersmith
8cdcdd1279 configure: updates to quiet obsolete macro warnings
Clears autoconf warnings:

configure.ac:38: warning: The macro 'AC_PROG_LIBTOOL' is obsolete.
configure.ac:38: You should run autoupdate.
aclocal.m4:3515: AC_PROG_LIBTOOL is expanded from...
configure.ac:38: the top level
configure.ac:68: warning: The macro 'AC_HELP_STRING' is obsolete.
configure.ac:68: You should run autoupdate.
./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
configure.ac:68: the top level
configure.ac:78: warning: The macro 'AC_HELP_STRING' is obsolete.
configure.ac:78: You should run autoupdate.
./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
configure.ac:78: the top level

libtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([m4])' to configure.ac,
libtoolize: and rerunning libtoolize and aclocal.
libtoolize: Consider adding '-I m4' to ACLOCAL_AMFLAGS in Makefile.am.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-12-02 15:03:41 -08:00
Alan Coopersmith
f642d1700c gitlab CI: ensure libtool is installed in build container
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-10-01 12:13:46 -07:00
Alan Coopersmith
8970519bf9 gitlab CI: stop requiring Signed-off-by in commits
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-02-09 12:06:54 -08:00
Alan Coopersmith
bf3c0cb38a xf86-input-synaptics 1.9.2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
xf86-input-synaptics-1.9.2
2022-07-10 16:32:38 -07:00
Alan Coopersmith
ae160fc87b Convert remaining source files from ISO-8859-1 to UTF-8
Most were already converted.  Fixes error raised by FlawFinder in CI:
Error: encoding error in ./src/synaptics.c
'utf-8' codec can't decode byte 0xa9 in position 16: invalid start byte

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-01-16 13:04:35 -08:00
Alan Coopersmith
74282e856c gitlab CI: add a basic build test
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-01-16 12:46:06 -08:00
Alan Coopersmith
592215a584 Fix spelling/wording issues
Found by using:
    codespell --builtin clear,rare,usage,informal,code,names

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-01-16 12:42:17 -08:00
Alan Coopersmith
6d6c2e7922 Build xz tarballs instead of bzip2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-01-16 12:37:06 -08:00
Pip Cet
3e4bc35dfe synclient: allow negative/large values for AreaLeftEdge etc. 2021-04-09 16:58:38 +00:00
Ariadne Conill
7c32bc6f1f eventcomm: fix compile with pre-time64 kernels 2020-07-28 04:04:23 -06:00
Ariadne Conill
073b1b40bd eventcomm: use 64-bit time safe accessors instead of timeval directly
when building on a 32-bit host with 64-bit time_t, using the
input_event and input_event_usec accessors are necessary to deal with
translation.
2020-07-22 02:29:08 -06:00
Matthieu Herrb
a4e5f74b58 Use fabs() instead of abs() on double values.
Silences clang warnings.

Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
Reviewed-by: Walter Harms <wharms@bfs.de>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-02-11 10:58:04 +10:00
Alan Coopersmith
f8d896ddca Update configure.ac bug URL for gitlab migration
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-11-25 12:50:31 -08:00
Alan Coopersmith
8e61f0d57e Update README for gitlab migration
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-11-18 12:05:15 -08:00
Peter Hutterer
a46338a992 synaptics 1.9.1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
xf86-input-synaptics-1.9.1
2018-05-29 13:17:59 +10:00
Peter Hutterer
9f3a6ac97e eventcomm: if we get a read error other than EAGAIN, remove the fd
Otherwise poll() keeps on triggering on our fd until udev gets around to
notifying the server that the device is in some state of deadness. Meanwhile,
the input thread is busy filling the log up with "Read error" messages. Great
way to test file systems and their capacity to handle out of space scenarios
but otherwise a bit pointless. Those FS developers should write their own
tests instead of relying on the synaptics driver!

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-05-15 10:35:38 +10:00
Luca Castagnini
59eb0c372b Replace SA_ONESHOT with the more portable SA_RESETHAND.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-10-26 08:41:12 +10:00
Peter Hutterer
6d3749105d Drop HandleTouches - it's a noop
With the removal of touch events in 0a4cf80a00, this function is a noop. It
merely counted the number of touches but discarded the result. And
UpdateTouchState does the update anyway.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-17 13:10:31 +10:00
Mihail Konev
afa8d7bb46 autogen: add default patch prefix
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
2017-01-26 14:00:21 +10:00
Emil Velikov
703b44fa68 autogen.sh: use quoted string variables
Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent
fall-outs, when they contain space.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26 11:26:20 +10:00
Peter Hutterer
3261e07c92 synaptics 1.9.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
xf86-input-synaptics-1.9.0
2016-11-18 13:00:09 +10:00
Peter Hutterer
a7d76f4275 synaptics 1.8.99.2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
xf86-input-synaptics-1.8.99.2
2016-10-09 19:29:29 +10:00
Peter Hutterer
35b9472a18 Remove unused fraction calculations
hw.x and the motion history are integers so our deltas are always integers.
It's a bit pointless to split them into the fractional and integral part.

obsolete since defc1d008e or so

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-09-15 13:50:56 +10:00
Peter Hutterer
486322116d eventcomm: don't ever probe if a device is set
If opening the fd fails we still need to fail the device. This is particularly
the case when a device disappears before we can open it - the current code
wouldn't exit but instead switch to auto-probe touchpad devices on the system.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-08-17 20:00:31 +10:00
Anton Lindqvist
cd9f979923 syndaemon: enable touchpad when pressing a modifier combo
When ignoring modifiers, ensure the touchpad is enabled once a modifier
key is pressed disregarding any previous key press that caused the
touchpad to be disabled.

Signed-off-by: Anton Lindqvist <anton.lindqvist@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-08 10:23:29 +10:00
Peter Hutterer
248c5936a0 Support XINPUT ABI version 23
Use input_lock/input_unlock calls instead of SIGIO functions

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-06-02 10:05:02 +10:00
Stefan Dirsch
59e5db0253 conf: rename to 70-synaptics.conf
Bump up the synaptics driver to 70, so it get's preferred over libinput, which
was dropped down to 60. The synaptics driver is more of a leaf package
than libinput (which covers a multitude of device types) and can be removed by
default. When specifically installed by the user, the synaptics driver should
override the system default.

Similar to what was done for wacom configuration file.

https://bugzilla.suse.com/show_bug.cgi?id=979554

Signed-off-by: Stefan Dirsch <sndirsch@suse.de>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-23 11:35:27 +10:00
Peter Hutterer
979fbec841 Revert MaxDoubleTapTime back to 180
Fallout from 90c6d7fc60 where it got changed to
100ms. This is too short for triple-tap-and-drag gestures so revert it to the
previous value.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-04-29 10:51:17 +10:00
Peter Hutterer
2a1a17244f synaptics 1.8.99.1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
xf86-input-synaptics-1.8.99.1
2016-04-29 08:49:07 +10:00
Peter Hutterer
f1f58fffbf eventcomm: fix typo checking for two-finger scrolling
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-04-27 09:29:27 +10:00
Peter Hutterer
0a4cf80a00 Drop touch events from the driver
This was a bad idea. No-one seems to use this and it gives us little benefits.
To even get this feature a number of other features need to be turned off
(like two-finger scrolling and tapping). Many of these are enabled by default,
if they are disabled a client stack with full touchpad gesture support could
in theory support true touchpad gestures. This has never happened.

Drop the touch events from the synaptics driver. This allows us to switch the
touchpad fully over to look like a relative device, thus also removing the
bug that changes the touchpad speed whenever a monitor is added/removed in.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-08-12 16:09:00 +10:00
Peter Hutterer
7aa327603f eventcomm: ignore key repeat events
Usually doesn't happen, but the evtest output in
https://bugs.freedesktop.org/show_bug.cgi?id=90392
actually has repeat events for the button. Ignore them if they happen.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-12 16:08:49 +10:00
Peter Hutterer
fc9f490a2c eventcomm: ignore fake and broken MT devices
An MT device without X/Y is not a touchpad. And neither are fake MT devices.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-03-25 07:29:00 +10:00
Peter Hutterer
30866b97be eventcomm: prevent possibly division by zero
This came up as a kernel bug, but it's valid to create uinput devices with a
min == max range for x/y. Technically valid, but effectively useless, so catch
it, complain and hobble on along.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-03-24 11:32:24 +10:00
Peter Hutterer
5378a020a0 Revert "Support the new Lenovo X1 Carbon 3rd trackpoint buttons"
This reverts commit 064445364b.

The Lenovo *50 series, including the X1 Carbon 3rd always require multiple
kernel patches to enable the touchpad buttons. This patch in synaptics only
addresses the re-routing of the top buttons.

The final iteration of the kernel patches also route the trackpoint buttons
through the trackpoint device, rendering this patch unnecessary. These patches
are queued for 4.0.

See kernel patch series up to commit cdd9dc195916ef5644cfac079094c3c1d1616e4c
Author: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Date:   Sun Mar 8 22:35:41 2015 -0700

    Input: synaptics - re-route tracksticks buttons on the Lenovo 2015 series

Currently in Dmitry's for-linus branch.

Distributions running older kernels or the kernel stable series which has
partial backports of the above patch series are encouraged to leave the
0644453 commit in and undo this revert.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-03-18 07:25:31 +10:00
Peter Hutterer
00db769067 conf: add Lenovo T450s and W451 to rules
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-03-06 11:07:02 +10:00
Gabriele Mazzotta
37d34f0356 Add a delay between the second button down-up event of double taps
Some applications ignore the second tap of double taps because of the
lack of a delay between the button down and button up events.

Prevent this by replacing the transition from TS_2B to TS_START with a
transition from TS_2B to TS_SINGLETAP that emits only a button down
event. The button up event will be emitted when transitioning from
TS_SINGLETAP to TS_START.

In addition, decrease the default value of MaxDoubleTapTime from 180 ms
to 100 ms in order to make double taps faster.

Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-02-18 16:52:56 +10:00
Peter Hutterer
064445364b Support the new Lenovo X1 Carbon 3rd trackpoint buttons
This device has the trackpoint buttons wired up to the touchpad to send BTN_0,
BTN_1 and BTN_2 for left, right, middle. This conflicts with previous
touchpads that used those event codes for dedicated scroll buttons.

Add an option HasTrackpointButtons that can be set via a xorg.conf.d
snippets. This option is not intended as a user-set option, rather
we expect distributions to ship some conglomerate of udev/hal rules with
xorg.conf snippets that take effect.

If the option is set, we look at the three affected buttons at the beginning
of HandleState and send button events immediately for them. The HW state is
reset to neutral and other processing continues. This saves us from having to
synchronize these buttons with software buttons (also present on this device),
tapping, etc.

Since the buttons are physically different and (mentally) associated with the
trackpoint device we also don't need to worry about having finger motion event
correctly synced up with the button presses - it's acceptable to send the
presses before the motion events.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-01-30 09:39:38 +10:00
Gabriele Mazzotta
a357647d3f Update machine state diagram
The diagram didn't entirely reflect the current state of the code.

Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-01-16 12:58:50 +10:00
Gabriele Mazzotta
383355fa5f Remove FastTap leftovers
FastTap was removed with d14ea867ad ("Purge fast-taps option"),
remove all of what remained.

Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-01-12 11:08:56 +10:00
Gabriele Mazzotta
a05894d169 Don't assume that touch devices report per finger width and pressure
The palm detection relies on both the width and the pressure.
a897147be0 ("Use ABS_MT events for the palm detection when supported")
assumed that all the touch devices can report both ABS_MT_TOUCH_MAJOR
and ABS_MT_PRESSURE, but this is not necessarily true. This assumption
could hence break the palm detection when at least one of the mentioned
events is not declared but both ABS_TOOL_WIDTH and ABS_PRESSURE are
reported.

Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-01-08 09:14:39 +10:00
Gabriele Mazzotta
a897147be0 Use ABS_MT events for the palm detection when supported
Use ABS_MT_TOUCH_MAJOR and ABS_MT_PRESSURE instead of ABS_TOOL_WIDTH
and ABS_PRESSURE when supported so that the pressure and the width of
all the fingers is taken into account for the palm detection.

This also fixes the palm detection for those touchpads for which the
kernel only sends ABS_MT_TOUCH_MAJOR and not ABS_TOOL_WIDTH.

Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-09-17 15:29:51 +10:00
Peter Hutterer
41b2312c00 Limit the movement to 20 mm per event
Touchpads are limited by a fixed sampling rate (usually 80Hz). Some finger
changes may happen too fast for this sampling rate, resulting in two distinct
event sequences:
* finger 1 up and finger 2 down in the same EV_SYN frame. Synaptics sees one
  finger down before and after and the changed coordinates
* finger 1 up and finger 2 down _between_ two EV_SYN frames. Synaptics sees one
  touchpoint move from f1 position to f2 position.

That move causes a large cursor jump. The former could be solved (with
difficulty) by adding fake EV_SYN handling after releasing touchpoints but
that won't fix the latter case.

So as a solution for now limit the finger movement to 20mm per event.
Tests on a T440 and an x220 showed that this is just above what a reasonable
finger movement would trigger. If a movement is greater than that limit, reset
it to 0/0.

On devices without resolution, use 0.25 of the touchpad's diagonal instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-09-17 14:47:17 +10:00