Commit graph

4733 commits

Author SHA1 Message Date
Peter Hutterer
f87fffd193 evdev: use filter_dispatch_constant() for the lenovo trackpoint "wheel"
Rather than normalizing manually, leave this up to the pointer acceleration
code.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-09-08 09:03:15 +10:00
Peter Hutterer
f80b142dc3 evdev: use filter_dispatch_constant() for button scrolling
Our pointer filter code has two functions - one for accelerated movement
and one for "constant" movement (i.e. no accel factor provided but same
conversions). Let's use that instead of a manual normalization.

This fixes an issue with button scrolling on high-dpi mice in the flat
pointer acceleration: normal pointer motion in the flat profile isn't
normalized but the button scrolling was - resulting in e.g. 5 times
slower motion for button scrolling on a 5000dpi mouse.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-09-08 09:03:15 +10:00
Peter Hutterer
cef91f5b43 filter: don't normalize the const filter approach
The filter vs const filter is supposed to be for accelerated vs
non-accelerated motion (e.g. pointer motion vs scrolling) - in both
cases the returned value is supposed to be in the same coordinate
system, just once with an extra accel factor applied.

This was broken in the flat and low-dpi profiles: in both of those the
accelerated filter does *not* normalize, it merely applies the fixed/adaptive factor.
The constant filter normalized however. The result was that on e.g. a
5000dpi mouse the constant motion was 5 times slower than the
accelerated motion, even with a factor of 1.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-09-08 09:03:15 +10:00
Peter Hutterer
fc1a28951a filter: constify the interfaces and make them static
No functional change

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-09-08 09:03:15 +10:00
Peter Hutterer
0bb82faab1 evdev: rename post_trackpoint_scroll to post_button_scroll
This is no longer trackpoint-only, so let's rename this.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-09-08 09:03:15 +10:00
Peter Hutterer
e59dc2ec58 filter: localize a few variables
No functional changes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-09-08 09:03:15 +10:00
Peter Hutterer
528f09a969 filter: constify the tracker API
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-09-08 09:03:15 +10:00
Peter Hutterer
b6e1f5d120 filter: remove an unnecessary layer of indirection
This is a leftover from when some of the filter code was shared between
pointer acceleration methods (pre v1.11 or so). Now these functions are
duplicated across files, so both the names and what they do isn't
necessarily reflective anymore.

Let's drop one layer of indirection to make the code a bit easier to
understand.

No functional changes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-09-08 09:03:15 +10:00
Peter Hutterer
87c769f3f2 filter: fix the mix of normalized vs device coordinates
No functional changes, this is just for improving readability and a
leftover when some of these functions were used by multiple filters.

This filter normalizes the data first, then applies the acceleration to
the normalized values. So let's keep the data in normalized_coords
structs and only drop to device_float_coords when we have to to use the
tracker API.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-09-08 09:03:15 +10:00
Peter Hutterer
9179acd638 filter: a few whitespace fixes and extra comments
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-09-08 09:03:15 +10:00
Peter Hutterer
70c57e9644 CI: drop the job count for the valgrind test suite to 2
Too many timing-related failures with 4 or (the default) 8 jobs, clearly
our runners aren't fast enough.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-09-02 08:41:34 +02:00
Benjamin Tissoires
24956221b9 CI: in b2c, compile on the host, then test in qemu
Looks like we are having clock skew issues on qemu, so given that
we just need qemu in the image, we can compile on the host (reliable)
and then only start the tests in qemu.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2022-09-02 08:41:28 +02:00
Benjamin Tissoires
a034a9f66b CI: start a full systemd environment before running the testsuite
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2022-09-02 08:39:44 +02:00
Benjamin Tissoires
46df4f588c CI: include systemd-udev in the fedora image
This will allow us to have the udevadm tool and systemd-udevd available
while running inside qemu

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2022-09-02 08:39:43 +02:00
Benjamin Tissoires
1ccbeabb0b CI: rely on b2c to start qemu tests
This allows us to not have to create a specific image, and also
should be more reliable because we don't have to boot a full distribution
each time we just start our test suite.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2022-09-02 08:39:42 +02:00
Benjamin Tissoires
fb4f4131a1 CI: do not retry the qemu runs
They should be more reliable now, so no need to try them twice

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2022-09-01 10:18:18 +10:00
Benjamin Tissoires
bafffb7ecb CI: remove unused test
I am pretty sure this one guard is a leftover from a previous version.
That is because use_for_custom_build_tests is true when
use_for_qemu_tests is, so probably a useless test here.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2022-09-01 09:39:12 +10:00
Benjamin Tissoires
553092ea93 CI: make freebsd slightly more in line with others
the combination of want_qemu and skip_container is not very straight
forward.

What we actually have, is that freebsd is only qemu based, so there is
no point in really having a `_QEMU` tag for it.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2022-09-01 09:39:02 +10:00
Benjamin Tissoires
0d602e12a4 CI: remove one occurrence of fedora instead of distro.name
For .{{distro.name}}-build@template, everything is parametrized with the
distro name, so having plain 'fedora' might bite us in the future.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2022-09-01 09:38:49 +10:00
Benjamin Tissoires
c8c825289f CI: prettify the include of templates
Makes the resulting file easier to read

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2022-09-01 09:38:46 +10:00
Peter Hutterer
6c2e98e40d gitlab-ci: add commandline options to the meson-build.sh script
The various --skip-build, --skip-test and --skip-setup skip the
respective step, the --run-test argument runs the test even where
MESON_TEST_ARGS is nil.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-08-31 16:01:26 +10:00
Peter Hutterer
30776d670b gitlab-ci: explicitly call "meson setup" to improve readability
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-08-31 15:41:35 +10:00
Peter Hutterer
4177093d49 gitlab-ci: export MESON_TESTTHREADS so meson actually sees it
Unlike NINJA_ARGS this isn't passed into meson, it's picked from the
env.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-08-31 15:37:37 +10:00
Peter Hutterer
c16844d1b2 evdev: remove duplicate "device is a switch" message
We log this a few lines south of here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-08-23 13:23:37 +10:00
Leonard Lausen
6efc4aa05c quirks: add generic quirks for ARM based chromebooks
Signed-off-by: Leonard Lausen <leonard@lausen.nl>
2022-08-22 00:48:18 +00:00
Leonard Lausen
62f8b53316 quirks: add quirks for Acer Spin 513 (Lazor)
Signed-off-by: Leonard Lausen <leonard@lausen.nl>
2022-08-15 16:22:28 +00:00
Peter Hutterer
507b0a38b3 tools: add missing dwtp option setting
Fixes 1f1ddbc6df

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-08-08 13:57:13 +10:00
Peter Hutterer
45db4ceb49 gitlab ci: drop EOL'd ubuntu 21.10
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-08-03 13:43:32 +10:00
Boris Pek
187ec90bb2 quirks: update quirks for Lenovo IdeaPad Duet 3
My tablet has substring pvrIdeaPadDuet310IGL5-LTE in modalias and there are
other modifications of this model on a market so the mask for DMI should be
simplified to cover more devices.

Signed-off-by: Boris Pek <bpek@astralinux.ru>
2022-07-18 11:06:22 +03:00
Peter Hutterer
91610165d9 doc/user: minor rewording of the pointer accel profile list
This just makes it easier to add new profiles to the list without ending
up with a word salad.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-07-15 10:47:13 +10:00
José Expósito
71f79b9de1 libwacom: fix warnings building without libwacom
When the libwacom build option is set to false the compiler throws
these warnings:

../udev/libinput-device-group.c:95:1: warning: ‘wacom_handle_ekr’ defined but not used [-Wunused-function]
   95 | wacom_handle_ekr(struct udev_device *device,
      | ^~~~~~~~~~~~~~~~
[205/237] Compiling C object 'libinput-test-suite@exe/test_test-tablet.c.o'.
../test/test-tablet.c:5440:1: warning: ‘verify_left_handed_touch_sequence’ defined but not used [-Wunused-function]
 5440 | verify_left_handed_touch_sequence(struct litest_device *finger,
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../test/test-tablet.c:5385:1: warning: ‘verify_left_handed_tablet_sequence’ defined but not used [-Wunused-function]
 5385 | verify_left_handed_tablet_sequence(struct litest_device *tablet,
 #     | ^~~~~~~~~~~~~~~~
 #     | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Add the required guards to fix the warnings.

Fix #791.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2022-07-12 19:44:59 +02:00
Peter Hutterer
368b12ad45 evdev: fix a tab vs space indentation issue
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-07-12 10:00:24 +00:00
illiliti
05501cd34f meson: use install_emptydir to create directory
instead of install_subdir. Fixes muon - a strictly-conforming meson
implementation which doesn't implement deprecated and broken-by-design
functionality.

For more info, see: https://mesonbuild.com/Reference-manual_functions.html#install_subdir

Signed-off-by: illiliti <illiliti@protonmail.com>
2022-07-12 00:05:06 +00:00
Maximilian Luz
238a56eb7c quirks: Add quirks to improve tablet-mode on the Surface Laptop Studio
The Microsoft Surface Laptop Studio can operate in multiple postures. In
one of these, dubbed "slate/tent", the screen is angled roughly 45°,
covering the keyboard but not the touchpad. Unfortunately, this state is
(as far as we can tell) indiscernible to the display being flipped 180°
backwards (dubbed "slate/flipped"), where the keyboard points away from
the user and is now behind the screen.

Due to this, it makes sense to enable tablet-mode in this (general)
"slate" state, which is what the corresponding kernel driver currently
does. This, for example, can tell desktop environments to bring up a
touch keyboard in certain situations and to allow for automatic screen
rotation (which is required in the "flipped" mode).

Unfortunately, libinput disables all integrated peripherals, including
the touchpad, when tablet-mode is on, rendering the touchpad unusable in
the "slate/tent" state. Therefore, set ModelTabletModeNoSuspend=1 to
keep the touchpad functional. For simplicity, apply this quirk to all
input devices on the Surface Laptop Studio. Those are already disabled
by firmware in the respective postures, meaning things work well without
suspension by libinput.

Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
2022-07-10 18:25:22 +00:00
Maximilian Luz
ad95d68f47 quirks: Add quirks for Surface Laptop Studio touchpad
The touchpad on the Microsoft Surface Laptop Studio is force-sensitive.
The default values used by libinput do not seem to work well (causing
touches to not be recognized), so configure it with known-good values.

Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
2022-07-10 18:25:22 +00:00
Max Huber
d137c41319 quirks: add volume rocker quirk for Lenovo IdeaPad Duet 3i
Signed-off-by: Max Huber <ycbcr@disroot.org>
2022-07-10 15:22:24 +02:00
Dale A. Jackson
a2dc175c19
quirks: add Lenovo Legion 7 keyboard
Fixes disable-when-typing for the keyboard model on this laptop

Signed-off-by: Dale A. Jackson <JacksonWrath@gmail.com>
2022-07-01 10:26:44 -07:00
Peter Hutterer
3475850084 CODING_STYLE: update with a better description for variable assignments
Loop variables shouldn't be re-used.

Avoid uninitialized variables

Sort variables to make function calls more obvious

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-06-29 14:37:58 +10:00
Peter Hutterer
68f39925ed gitlab CI: dnf remove gtk4-devel for the no-debug-gui deps job
We've long preferred GTK4 and that's installed on our images, so let's
make sure that gets removed together with GTK3 (which isn't actually
installed anyway).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-06-28 23:09:53 +00:00
Peter Hutterer
1f505ce2e9 meson.build: fix build without Wayland
Introduced in 6a1bd5b0c9, we now have two potentially undeclared
variables if GTK is available but doesn't have Wayland support.

../meson.build:576:1: ERROR: Unknown variable "dep_wayland_client".

Fixes 6a1bd5b0c9
Fixes #786

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-06-28 23:09:53 +00:00
satrmb
4a202a95c0 test: exclude the two high-delay debounce tests from the valgrind CI run
The `debounce_bounce_high_delay` and `debounce_spurious_trigger_high_delay`
tests are failing with annoying frequency in valgrind, but that is
entirely due to valgrind being too slow for the tight timing reqirements
of these tests. Skipping them in valgrind has next to no potential to hide
memory leaks because the code paths leading to success are also covered by
other tests which are less picky about timing, and the CI test suite run
without valgrind still tests for their success.

Signed-off-by: satrmb <10471-satrmb@users.noreply.gitlab.freedesktop.org>
2022-06-28 13:22:25 +02:00
Peter Hutterer
6569938b1a meson.build: drop listing of header files from compilation targets
"Meson uses Ninja which uses compiler dependency information to
automatically figure out dependencies between C sources and headers, so
it will rebuild things correctly when a header changes. [...]
If, for whatever reason, you do add non-generated headers to the sources
list of a target, Meson will simply ignore them."

https://mesonbuild.com/FAQ.html#do-i-need-to-add-my-headers-to-the-sources-list-like-in-autotools

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-06-16 08:28:53 +10:00
Peter Hutterer
2d3eee76ad gitlab CI: drop the manual meson to junit conversion
Meson supports this natively since version 0.55 which is available in
all our tested distributions.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-06-14 13:11:14 +10:00
José Expósito
bc363328a7 libinput 1.21.0
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2022-06-11 13:47:52 +02:00
Peter Hutterer
7888ef2787 gitlab CI: bump to F35 and F36, as well as Ubuntu 21.10 and 22.04
F33 and F34 are both EOL. This also fixes the RPM build job to
automatically use the latest Fedora version and adds
wayland-protocols-devel which is now needed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-06-11 10:54:15 +00:00
Peter Hutterer
6a1bd5b0c9 meson.build: check gtk targets before building
We have two different dependencies on Wayland: GTK support and the
wayland-protocols we use directly. If we have GTK support but
wayland-protocols is not installed at meson configure time, our build
fails.

To avoid having multiple ifdefs in the code, let's define two new ones:
HAVE_GTK_WAYLAND and HAVE_GTK_X11, both set if GTK supports that
particular target (from pkgconfig) and we have the other support
libraries we need.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-06-11 10:54:15 +00:00
Peter Hutterer
3542023996 test: fix a typo
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-06-08 09:25:59 +10:00
Peter Hutterer
d833f265c0 test: use a ranged test instead of a duplicated one
These two tests were identical except for the WHEEL/HWHEEL
differentiator, let's make this into a ranged test instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-06-08 09:25:02 +10:00
José Expósito
4ae72b6eb2 wheel: fix Lenovo Scrollpoint quirk
The IBM/Lenovo Scrollpoint mouse features a trackpoint-like stick that
sends a great amount of scroll deltas.

In order to handle the device, a quirk is in place to normalize the
scroll events as they were relative motion.

However, when high-resolution scroll was implemented, we started
normalizing the hi-res events instead of the lo-res events by mistake.

Fix the quirk by normalizing the right deltas.

Fixes: 6bb02aaf30 ("High-resolution scroll wheel support")
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Tested-by: Peter Ganzhorn <peter.ganzhorn@gmail.com>
2022-06-07 19:55:42 +02:00
Peter Hutterer
7688f35477 test: ensure we always have an axis event where we expect one
If we never got an event, we'd skip over the while loop and generate a
false positive.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-06-07 12:42:50 +10:00