Commit graph

294 commits

Author SHA1 Message Date
José Expósito
fc59e574e0 libinput 1.22.0
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2022-11-19 12:21:06 +01:00
José Expósito
9c789cc254 tools: hide debug-gui help when building with -Ddebug-gui=false
Some distributions, like Fedora, compile libinput with the debug-gui
option set to false.

Running "libinput debug-gui" indicates that the program is not
installed; however, the help message suggests that  the command is
available.

Hide debug-gui from the help message when it is not included.

Fix https://gitlab.freedesktop.org/libinput/libinput/-/issues/480
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2022-10-10 08:27:05 +02:00
José Expósito
e9a1999a7f meson.build: always set HAVE_GTK_WAYLAND
In commit 6a1bd5b0c9 ("meson.build: check gtk targets before
building") introduced a custom config option to check whether Wayland
is supported by GTK or not.

However, in some cases the config option is not set generating this
warning:

    ../tools/libinput-debug-gui.c:51:5: warning: "HAVE_GTK_WAYLAND" is
    not defined, evaluates to 0 [-Wundef]
       51 | #if HAVE_GTK_WAYLAND
          |     ^~~~~~~~~~~~~~~~

Make sure to always set HAVE_GTK_WAYLAND.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2022-10-09 20:07:59 +02:00
Peter Hutterer
ad71c74885 filter: add a flat trackpoint accel
Previously, trackpoints got assigned the normal flat profile which does not
accommodate for the trackpoint magic multiplier *and* had a config range
that was too small if you take the multiplire indo account anyway.

Fix this by adding a trackpoint-specific flat accel that has a wider
configuration range and take sthe magic multiplier into account.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-09-08 09:03:15 +10: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
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
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
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
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
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
5dd751a3d0 test: install libinput-test-utils as part of install-tests
This tests a bunch of internal utility functions that may work
differently depending on compiler flags, etc. Let's make that test
available so it can be verified on an installed system.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-05-09 05:03:00 +00:00
Peter Hutterer
43a8d769ac tools: add a libinput test tool as entry point for our test suites
We already install libinput-test-suite if the meson option install-tests
is set, see
  commit be7045cdc7
  test: make the test suite runner available as installed binary

To make other tests easily available and more discoverable, add a new
tool "libinput test" with the matching man page. This will also help us
to enforce some of the namespacing a bit better.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-05-09 05:03:00 +00:00
Peter Hutterer
a423d7d326 evdev: strip the device name of format directives
This fixes a format string vulnerabilty.

evdev_log_message() composes a format string consisting of a fixed
prefix (including the rendered device name) and the passed-in format
buffer. This format string is then passed with the arguments to the
actual log handler, which usually and eventually ends up being printf.

If the device name contains a printf-style format directive, these ended
up in the format string and thus get interpreted correctly, e.g. for a
device "Foo%sBar" the log message vs printf invocation ends up being:
  evdev_log_message(device, "some message %s", "some argument");
  printf("event9 - Foo%sBar: some message %s", "some argument");

This can enable an attacker to execute malicious code with the
privileges of the process using libinput.

To exploit this, an attacker needs to be able to create a kernel device
with a malicious name, e.g. through /dev/uinput or a Bluetooth device.

To fix this, convert any potential format directives in the device name
by duplicating percentages.

Pre-rendering the device to avoid the issue altogether would be nicer
but the current log level hooks do not easily allow for this. The device
name is the only user-controlled part of the format string.

A second potential issue is the sysname of the device which is also
sanitized.

This issue was found by Albin Eldstål-Ahrens and Benjamin Svensson from
Assured AB, and independently by Lukas Lamster.

Fixes #752

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-04-20 13:32:31 +10:00
Peter Hutterer
423bb6455f meson: replace a meson.source_root() with the explicit directory
Removes the warning that source_root() has been deprecated since 0.56.0

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-03-28 21:41:58 +00:00
José Expósito
7850e4aecd libinput 1.20.0
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2022-02-19 13:32:09 +01:00
José Expósito
8e41089584 libinput 1.19.901
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2022-02-03 07:56:40 +01:00
Peter Hutterer
e4548f5805 meson.build: disable -Wunused when building the litest selftest
We use check directly to test the various litest bits, so if ifdef out
the litest main() and a few other bits. This results in compiler
warnings that aren't worth fixing - a lot of moving code around for no
real benefit.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-12-23 08:18:06 +10:00
Peter Hutterer
167cebf7de test: add a test device for the Wacom 524C device
This device triggers a kernel bug in the InRange and Invert handling,
every time BTN_TOUCH is set the device also sets BTN_TOOL_PEN even when
we currently have the eraser in proximity.

Recording from https://github.com/linuxwacom/xf86-input-wacom/issues/186

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-12-14 08:09:20 +00:00
José Expósito
4e52f03580 wheel: centralize wheel handling
Move the logic to handle wheels to its own file.
Refactor, no functional changes.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-11-08 18:00:34 +01:00
Peter Hutterer
ac385e12dc libinput 1.19.2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-10-21 14:19:49 +10:00
Peter Hutterer
b3e5846410 libinput 1.19.1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-09-28 08:46:37 +10:00
Peter Hutterer
ca0c2470d7 libinput 1.19.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-09-14 17:52:56 +10:00
Peter Hutterer
01cccd8387 libinput 1.18.901
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-09-01 14:09:26 +10:00
José Expósito
375618b81b meson.build: use the / operator instead of join_paths
Starting with meson v0.49.0, the "/" operator can be used instead of
join_paths.

Update meson to v0.49.0 and remove all calls to join_paths.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-08-03 20:00:37 +02:00
José Expósito
be7264f35b debug-gui: pointer locking on X11
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-08-03 16:52:39 +00:00
José Expósito
a9b334ebb5 debug-gui: pointer locking on Wayland
Use the pointer constraints protocol to lock the pointer on Wayland.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-08-03 16:52:39 +00:00
José Expósito
895e866da6 debug-gui: migrate to GTK4
Global:

- Stop passing commandline arguments to gtk_init:
  https://docs.gtk.org/gtk4/migrating-3to4.html#stop-passing-commandline-arguments-to-gtk_init

window_init function:

- gtk_window_new doesn't require a type anymore

- gtk_window_iconify has been renamed to gtk_window_minimize

- gtk_container_add has been removed in favor of container specific
  APIs. Use gtk_window_set_child in this case.

- gtk_widget_show_all has been removed, widgets are now visible by
  default:
  https://docs.gtk.org/gtk4/migrating-3to4.html#widgets-are-now-visible-by-default

- gtk_widget_set_events to NULL is no longer required, widgets must set
  their event handlers explicitly now:
  https://blog.gtk.org/2020/04/29/custom-widgets-in-gtk-4-input/

window_delete_event_cb function:

- Use the new close-request event:
  https://docs.gtk.org/gtk4/migrating-3to4.html#stop-using-gtkwidget-event-signals

map_event_cb function:

- gtk_widget_set_cursor_from_name instead of gdk_window_set_cursor

- Wait until the draw area is resized to use the whole window to start
  calculating sizes

window_place_ui_elements function:

- Use gtk_widget_get_width and gtk_widget_get_height instead of
  gtk_window_get_size

Drawing:

- Use gtk_drawing_area_set_draw_func instead of the GtkWidget::draw
  signal:
  https://docs.gtk.org/gtk4/migrating-3to4.html#adapt-to-drawing-model-changes

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-08-03 16:52:39 +00:00
Peter Hutterer
7cccee251f Disable -Wmissing-field-initializers
We really don't care about that one.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-07-22 23:14:43 +00:00
Peter Hutterer
9cd6f3c5b8 meson.build: bump to 1.18.900
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-06-10 11:46:41 +10:00
José Expósito
279d14b392 gesutures: allow to configure hold gestures
Valgrind can be too slow to run some time based tests. In those cases, we
need to disable hold gestures.

Add the required functions to configure hold gestures: enable, disable,
get default state and get current state.

Keep them private as they are intended to be used only from the tests.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-06-09 01:18:58 +00:00
Peter Hutterer
2599b0d899 libinput 1.18.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-06-02 13:06:37 +10:00
Peter Hutterer
0432fe59ad libinput 1.17.901
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-05-26 13:17:59 +10:00
Peter Hutterer
f1b16c18e5 meson.build: bump to 1.17.900
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-05-05 12:46:33 +10:00
Peter Hutterer
9477d91d69 libinput 1.17.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-02-23 19:02:45 +10:00
Peter Hutterer
6a6435ae4b tools: add a tool to print a libinput recording as a table
This makes it easier to visualize changes in various axes or key states that
should not be there, doubly so for long recordings.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-02-23 13:46:00 +10:00
Peter Hutterer
9323cdfc11 meson.build: build libinput replay as well
Just like the other python-based tools it's just a basename copy, so let's be
consistent here and have all tools perform that way.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-02-23 13:30:42 +10:00
Peter Hutterer
1b8dd97092 meson.build: consolidate all man pages
They all use the same configure_file() process, so let's do them all in a
loop.

Exceptions are the test-suite man page.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-02-18 01:00:53 +00:00
Peter Hutterer
82e974ef1d meson.build: drop the dummy config data and use copy: true instead
We require the meson version this was introduced in, so let's use it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-02-18 01:00:53 +00:00
Peter Hutterer
115a8ff141 libinput 1.16.902
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-02-16 13:10:18 +10:00
Peter Hutterer
d3115f4875 test: drop the custom group names
The group names are forced by check (they are called suite names there) but
for our test suite they provide very little benefit. Much easier to just
use the filename a test is in as group name.

This removes the pure substring match for --filter-group, it's now fnmatch
only. group names are short enough that the typing isn't an issue and we don't
want to run tests twice (e.g. 'pad' is also in 'touchpad').

This patch caused #574 until it got fixed in d838e3a3a4

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-02-12 15:24:15 +10:00
Peter Hutterer
d1f900f764 Create /etc/libinput on install
Users that need to create the local-overrides.quirks are sometimes hesitant to
do so because /etc/libinput doesn't exist by default. Let's create it on
install.

Related #568

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-02-08 04:28:42 +00:00
Peter Hutterer
61e41df901 touchpad: disable the pressure axes wherever the resolution is nonzero
The kernel/udev set the pressure resolution to nonzero to indicate the value
is in a known scale (units/g). We use that information to disable the
pressure axis on such devices - real pressure cannot be translated to
contact size.

For the kernel patch see:
https://www.spinics.net/lists/linux-input/msg71237.html

Fixes #569

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-02-08 03:38:26 +00:00
Peter Hutterer
affc3d929a libinput 1.16.901
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-02-01 19:14:10 +10:00
Peter Hutterer
ff598741a9 tools: add a tool to analyze the finger count from a recording
Given a libinput recording, print the timestamps of any finger changes, i.e.
which slots are currently logically down. For example:

Timestamp | Rel time |     Slots     |
--------------------------------------
 0.000000 |  +0.000s | + |   |   |   |
 0.454631 |  +0.454s |   |   |   |   |
 5.065401 |  +4.610s | + |   |   |   |
 6.140281 |  +1.074s | + | + |   |   |
 7.410377 |  +1.270s |   | + |   |   |
 7.420200 |  +0.009s |   |   |   |   |
11.233108 |  +3.812s | + | + |   |   |
11.850206 |  +0.617s |   |   |   |   |
13.827740 |  +1.977s | + |   |   |   |
14.704027 |  +0.876s | + | + |   |   |
16.050577 |  +1.346s | + |   |   |   |
16.905186 |  +0.854s |   |   |   |   |

This data is available with the per-slot-delta tool but the output here is
more compressed, making it easier to detect stuck fingers. Pressure
thresholds are not currently supported.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-01-29 08:06:53 +10:00
Peter Hutterer
53595cb232 quirks: disable pressure on the Lenovo Yoga 9i touchpad
This touchpad is a true pressurepad and the pressure axis gives us physical
pressure down. Using it as contact size gives flaky touch detection, so let's
just disable the axis until we do something with that value.

Fixes #562

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-01-14 13:42:59 +10:00
Peter Hutterer
e882bd0216 quirks: add AttrInputPropEnable and Disable
The latter requires libevdev 1.10 but since that'll take a while to filter
into our various CI systems, let's make it conditional.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-10-23 13:35:50 +10:00
Peter Hutterer
e3c4ff3898 quirks: add AttrEventCodeEnable as counterpoint to the disable one
Currently unused, but let's get this in because we may need this very soon for
broken tablets.

Enabling EV_ABS axes requires an absinfo struct - we default to a simple 0-1
axis range for those as the most generic option. Anything more custom will
need more custom treatment when we need it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-10-23 13:35:50 +10:00
Peter Hutterer
f86d6a6e5a meson.build: add a few compiler warnings and make them compiler-conditional
These seem like a decent-enough set to have, only -Wlogical-op actually
produced a new warning.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-09-09 13:57:39 +10:00
Peter Hutterer
c6f87ade84 meson.build: drop the separate cpp flags
All we care about for C++ is that we build.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-09-09 13:57:39 +10:00
Peter Hutterer
ad2216b4c8 meson.build: bump minimum version to 0.47
It's been out for 2 years.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-09-09 12:36:28 +10:00