summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* libinput 1.19.41.19.41.19-branchPeter Hutterer2022-04-201-1/+1
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* evdev: strip the device name of format directivesPeter Hutterer2022-04-207-12/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> (cherry picked from commit a423d7d3269dc32a87384f79e29bb5ac021c83d1)
* libinput 1.19.31.19.3Peter Hutterer2021-12-131-1/+1
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* quirks: changes touchpad pressure Lenovo Yoga 2 ProJoaquin Gonzalez2021-12-131-0/+8
| | | | | | | Adds touchpad pressure configuration for Lenovo Yoga 2 Pro in order to avoid random cursor jumps on finger up. Signed-off-by: Joaquin Gonzalez <joaquin.gonzalez.uy@gmail.com> (cherry picked from commit 0bd1560750f7aa84cde173976e31c452586ec63b)
* doc/user: fix broken link to "Observations on trackpoint input data"José Expósito2021-12-131-1/+1
| | | | | Signed-off-by: José Expósito <jose.exposito89@gmail.com> (cherry picked from commit 556e4114b8e804b478feb50009373cbb4d854034)
* quirks: add ModelBouncingKeys for A4Tech X-710BK MouseAlexander Radovich2021-12-131-0/+5
| | | | | Signed-off-by: Alexander Radovich <rexuru17@gmail.com> (cherry picked from commit 35c5ef4e303116bc7f3c74948819ac9583b6897f)
* quirks: Dell 15R touchpad settings for firmware v3Gary Wolfe2021-12-131-1/+2
| | | | | | | | Trackpad sensitivity adjustment only needed for v3 for Dell Inspiron 15R N5110. Fixes #565 and #676. Signed-off-by: Gary Wolfe <avidgamefan@yahoo.com> (cherry picked from commit 607abecfbd771cf1afe8a7ee9c2f738fe729395e)
* gestures: cancel hold gestures on thumb detectionJosé Expósito2021-12-131-1/+1
| | | | | | | | | | | | | | | Before hold gestures where implemented, when a thumb was detected it was enough to reset the state machine. However, now it is possible to detect a thumb while a hold gesture is in course. Cancel any ongoing gesture when a thumb is detected to avoid dropping the gesture end event. See #693 Signed-off-by: José Expósito <jose.exposito89@gmail.com> (cherry picked from commit 5e44861e0ed7fdb447170a03adb9ff361ae6e4ce)
* doc/user: fix broken link to systemd 60-evdev.hwdbJosé Expósito2021-12-131-1/+1
| | | | | Signed-off-by: José Expósito <jose.exposito89@gmail.com> (cherry picked from commit be3c09bc1562b20db3e6533ab2e3347d05376a11)
* libinput 1.19.21.19.2Peter Hutterer2021-10-211-1/+1
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* quirks: add quirk for GPD Win MaxA-w-x2021-10-201-0/+5
| | | | | | clickpad that announces BTN_RIGHT Signed-off-by: A-w-x <awxkrnl@gmail.com>
* test: use a plain libinput context for the log priority checkPeter Hutterer2021-10-191-2/+19
| | | | | | | Don't use the litest wrapper context here, it changes log priority if the test suite is run with --verbose, causing the test to fail. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* quirks: relax DMI modalias match for Purism Librem 14v1Travis Wrightsman2021-10-111-1/+1
| | | | | | Both "svnPurism:pnLibrem14:" and "svnPurism:pnlibrem_14:" are possible Signed-off-by: Travis Wrightsman <travis@wrightsman.org>
* evdev: avoid usage of bogus BTN_FORWARD nameEduardo de Souza Cruz2021-10-111-1/+1
| | | | Signed-off-by: Eduardo Cruz <eduardo.cruz@kdemail.net>
* quirks: Update dmi for StarBook Mk VSean Rhodes2021-10-111-2/+2
| | | | Signed-off-by: Sean Rhodes <sean@starlabs.systems>
* evdev: disable button scroll timeout for extra mouse buttonsEduardo de Souza Cruz2021-10-101-18/+27
| | | | Signed-off-by: Eduardo Cruz <eduardo.cruz@kdemail.net>
* gestures: avoid processing the last hold and motion event twiceJosé Expósito2021-10-071-3/+3
| | | | | | | | | | During the transition from GESTURE_STATE_HOLD_AND_MOTION to GESTURE_STATE_POINTER_MOTION the last pointer motion event was processed twice. Fix #680 Signed-off-by: José Expósito <jose.exposito89@gmail.com>
* quirks: Add quirk for StarLabs clickpads with two phyisical buttonsSean Rhodes2021-10-041-0/+41
| | | | Signed-off-by: Sean Rhodes <sean@starlabs.systems>
* libinput 1.19.11.19.1Peter Hutterer2021-09-281-1/+1
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* fallback: hires scroll heuristics for buggy devicesJosé Expósito2021-09-276-0/+146
| | | | | | | | | | | | | | Some devices might announce support for high-resolution scroll wheel by enabling REL_WHEEL_HI_RES and/or REL_HWHEEL_HI_RES but never send a high-resolution scroll event. When the first low-resolution scroll event is received without any previous high-resolution event, print a kernel bug warning and start emulating high-resolution scroll events. Fix #668 Signed-off-by: José Expósito <jose.exposito89@gmail.com>
* test: add kernel bugs to log handlerJosé Expósito2021-09-271-1/+2
| | | | Signed-off-by: José Expósito <jose.exposito89@gmail.com>
* quirks: update the Dell N5110 touchpad quirkPeter Hutterer2021-09-281-1/+1
| | | | | | | | | | Later versions of this same model seem to have a different ALPS touchpad and don't need the pressure settings. Narrow down this match so we only apply to the one from the actual bug report in #565. Fixes #676 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* quirks: add quirk for the Prestigio Smartbook 141 C2 touchpadPeter Hutterer2021-09-271-0/+7
| | | | | | Fixes #674 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* libinput: add hold to get base eventJosé Expósito2021-09-242-2/+7
| | | | | | | | | | | LIBINPUT_EVENT_GESTURE_HOLD_BEGIN and LIBINPUT_EVENT_GESTURE_HOLD_END were missing from libinput_event_gesture_get_base_event. Add them to avoid triggering an erroneous client bug warning. Fix #671 Signed-off-by: José Expósito <jose.exposito89@gmail.com>
* evdev: v120 scroll: invert horizontal scrolling quirkJosé Expósito2021-09-211-0/+5
| | | | | | | | | When required, invert horizontal scrolling in evdev_notify_axis_wheel following the QUIRK_MODEL_INVERT_HORIZONTAL_SCROLLING quirk. Fix #669 Signed-off-by: José Expósito <jose.exposito89@gmail.com>
* touchpad: mark USB touchpads as internal by defaultPeter Hutterer2021-09-211-10/+3
| | | | | | | | | | | External touchpads using USB are vanishingly few, built-in touchpads that use USB are comparatively common. So let's default to internal, for vendors like Logitech and Wacom that only make external touchpads we have special conditions in place anyway. Fixes #664 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* touchpad: use the model flags to determine internal vs externalPeter Hutterer2021-09-211-3/+2
| | | | | | | When pairing a trackpoint, use the model flags for the touchpad, don't use a separate set of conditions. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* doc: guarantee end sequence for continuous scrollJosé Expósito2021-09-191-4/+4
| | | | | | | | | | | | | | | | | GTK handles LIBINPUT_EVENT_POINTER_SCROLL_CONTINUOUS as GDK_SCROLL_SMOOTH, the same event type that is used to handle LIBINPUT_EVENT_POINTER_SCROLL_FINGER. Because Mutter and other compositors, like wlroots based compositors, translate libinput terminating event to axis_stop instead of doing their own emulation, if libinput stops sending terminating events, it will cause client bugs. Since libinput always sends the terminating event for trackpoints and button scrolling and there are even tests in place to check for them, update the documentation to guarantee the terminating scroll sequence. Signed-off-by: José Expósito <jose.exposito89@gmail.com>
* touchpad: reduce the jumping cursor warnings to 5 per dayPeter Hutterer2021-09-173-2/+9
| | | | | | | | | | | | | | It's been a while since we really could do something about those jumps, so let's assume most of these are informative and not a bug in libinput. For that let's not spam the user's journal and ratelimit it to a handful a day. Per day because that increases the chance of an error being present in the recent logs if the user does search for it. Related #663 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* touchpad: fix leak when the touchpad is removed before the dwt keyboardPeter Hutterer2021-09-152-0/+24
| | | | | | | | | | | | | | If a touchpad is removed before its dwt-paired keyboard, we're leaking the keyboard struct. Fix this by cleaning up properly when our device is removed. This is the cause of many failed tests in the udev backend tests during the CI valgrind run. Because we're testing the udev backend it will add any devices created by tests run in parallel, some of which are keyboard devices. Depening on the test completions, the keyboards may or may not get removed before this device. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* libinput 1.19.01.19.0Peter Hutterer2021-09-141-1/+1
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* quirks: no button debouncing on generic emulated mouseJosé Expósito2021-09-121-0/+6
| | | | | | | | | | | | | When the kernel doesn't support a touchpad, the device is handled as a generic mouse named "ImPS/2 Generic Wheel Mouse". Taps are handled as button clicks and the button debouncing code makes it difficult to double click. Add a quirk to disable button debouncing for this devices. Fix https://gitlab.freedesktop.org/libinput/libinput/-/issues/656 Signed-off-by: José Expósito <jose.exposito89@gmail.com>
* util: add a function to parse bool propertiesJosé Expósito2021-09-125-19/+59
| | | | | | | | | Move the logic used to parse boolean quirks and udev flags to a common function in utils. Refactor, no functional changes. Signed-off-by: José Expósito <jose.exposito89@gmail.com>
* use ARRAY_FOR_EACH when traverse arrayweizhixiang2021-09-121-4/+4
| | | | Signed-off-by: weizhixiang <weizhixiang@uniontech.com>
* quirks: Microsoft Surface Pro 3 CoverJosé Expósito2021-09-061-0/+5
| | | | | | | | Mark the Microsoft Surface Pro 3 Cover keyboard as internal. Fix https://gitlab.freedesktop.org/libinput/libinput/-/issues/655 Signed-off-by: José Expósito <jose.exposito89@gmail.com>
* doc: add missing literal blocks in contributingJosé Expósito2021-09-061-5/+5
| | | | | | | Add missing literal blocks in the section "Failed pipeline errors" introduced in 140b4b78530b62f8dc70645153b75b4adae23ed9. Signed-off-by: José Expósito <jose.exposito89@gmail.com>
* quirks: Pine64 PineBook Pro keyboardClayton Craft2021-09-051-0/+6
| | | | | | The keyboard is 'internal' (built-in), and attached over usb. Signed-off-by: Clayton Craft <clayton@craftyguy.net>
* libinput 1.18.9011.18.901Peter Hutterer2021-09-011-1/+1
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* High-resolution scroll wheel supportPeter Hutterer2021-08-3126-321/+1497
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Starting with kernel v5.0 two new axes are available for high-resolution wheel scrolling: REL_WHEEL_HI_RES and REL_HWHEEL_HI_RES. Both axes send data in fractions of 120 where each multiple of 120 amounts to one logical scroll event. Fractions of 120 indicate a wheel movement less than one detent. This commit adds a new API for scroll events. Three new event types that encode the axis source in the event type name and a new API to get a normalized-to-120 value that also used by Windows and the kernel (each multiple of 120 represents a logical scroll click). This addresses a main shortcoming with the existing API - it was unreliable to calculate the click angle based on the axis value+discrete events and thus any caller using the axis value alone would be left with some ambiguity. With the v120 API it's now possible to (usually) calculate the click angle, but more importantly it provides the simplest hw-independent way of scrolling by a click or a fraction of a click. A new event type is required, the only way to integrate the v120 value otherwise was to start sending events with a discrete value of 0. This would break existing xf86-input-libinput (divide by zero, fixed in 0.28.2) and weston (general confusion). mutter, kwin are unaffected. With the new API, the old POINTER_AXIS event are deprecated - callers should use the new API where available and discard any POINTER_AXIS events. Notable: REL_WHEEL/REL_HWHEEL are emulated by the kernel but there's no guarantee that they'll come every accumulated 120 values, e.g. Logitech mice often send events that don't add up to 120 per detent. We use the kernel's wheel click emulation instead of doing our own. libinput guarantees high-resolution events even on pre-5.0 kernels. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: José Expósito <jose.exposito89@gmail.com>
* test: refactor litest_assert_event_type logicJosé Expósito2021-08-311-9/+43
| | | | | | | | | | Extract the logic in litest_assert_event_type to a generic function, litest_assert_event_type_is_one_of, that takes a variable number of expected event types. Refactor, no functional changes. Signed-off-by: José Expósito <jose.exposito89@gmail.com>
* quirks: Thinkpad T470 trackpoint multiplierDmitry Maluka2021-08-261-0/+5
| | | | | | | | | | | | | | | | Set multiplier for T470 to 0.4, same as for T480. Trackpoint behavior on T470 was good before 1.9.0 (more precisely, before the commit 87b568) when a new trackpoint acceleration algorithm was introduced instead of the traditional linear filter. Since then it is too sensitive and seems impossible to fine-tune using hw settings or libinput accel speed setting. With multiplier set to 0.4 it is as good (or better) as in 1.8.4. Sensitivity feels the same as in 1.8.4 with the same hw settings for speed and sensitivity. Signed-off-by: Dmitry Maluka <dmitrymaluka@gmail.com>
* quirks: Lenovo Trackpoint Keyboard IIJosé Expósito2021-08-244-1/+24
| | | | | | | | | | The device sends its own scroll events when its trackpoint is moved while the middle button is pressed. Because scroll events are inhibited while the middle button is pressed a quirk is necessary for this device to not inhibit scroll events. Signed-off-by: José Expósito <jose.exposito89@gmail.com>
* test: create devices for our udev seat checksPeter Hutterer2021-08-091-30/+29
| | | | | | | This way we can ensure that at least one device is available, and that it is the device we want. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* editorconfig: add settings for meson filesJosé Expósito2021-08-041-0/+4
| | | | Signed-off-by: José Expósito <jose.exposito89@gmail.com>
* test: use MESON_TESTTHREADS to determine the number of jobsPeter Hutterer2021-08-032-4/+9
| | | | | | | | | | | | meson uses MESON_TESTTHREADS to determine the number of parallel test jobs. Since our main test suite cannot be run in parallel anyway, use that same variable in litest to determine how many jobs we should fork off. In the CI pipeline, we can use FDO_CI_CONCURRENT to pass that down so we don't end up running a billion jobs on a test runner. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* meson.build: use the / operator instead of join_pathsJosé Expósito2021-08-033-27/+27
| | | | | | | | | 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>
* ci: update to GTK 4 when availableJosé Expósito2021-08-032-15/+15
| | | | | | | | | Update GTK to version 4 on Fedora, Arch and Alpine Linux. Not updating Debian and FreeBSD because the package is not available yet and Ubuntu because it is not available on 20.10. Signed-off-by: José Expósito <jose.exposito89@gmail.com>
* debug-gui: pointer locking on X11José Expósito2021-08-032-0/+67
| | | | Signed-off-by: José Expósito <jose.exposito89@gmail.com>
* debug-gui: pointer locking on WaylandJosé Expósito2021-08-034-12/+172
| | | | | | Use the pointer constraints protocol to lock the pointer on Wayland. Signed-off-by: José Expósito <jose.exposito89@gmail.com>
* debug-gui: migrate to GTK4José Expósito2021-08-032-5/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>