summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* tools: add missing dwtp option settingPeter Hutterer2022-08-081-0/+3
| | | | | | Fixes 1f1ddbc6dff0cf0451e3c9ac923f9821278560aa Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* gitlab ci: drop EOL'd ubuntu 21.10Peter Hutterer2022-08-032-34/+0
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* quirks: update quirks for Lenovo IdeaPad Duet 3Boris Pek2022-07-181-2/+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>
* doc/user: minor rewording of the pointer accel profile listPeter Hutterer2022-07-151-6/+8
| | | | | | | 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>
* libwacom: fix warnings building without libwacomJosé Expósito2022-07-122-1/+3
| | | | | | | | | | | | | | | | | | | | | | | 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>
* evdev: fix a tab vs space indentation issuePeter Hutterer2022-07-121-12/+12
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* meson: use install_emptydir to create directoryilliliti2022-07-121-1/+5
| | | | | | | | | | 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>
* quirks: Add quirks to improve tablet-mode on the Surface Laptop StudioMaximilian Luz2022-07-101-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* quirks: Add quirks for Surface Laptop Studio touchpadMaximilian Luz2022-07-101-0/+7
| | | | | | | | 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>
* quirks: add volume rocker quirk for Lenovo IdeaPad Duet 3iMax Huber2022-07-101-0/+5
| | | | Signed-off-by: Max Huber <ycbcr@disroot.org>
* quirks: add Lenovo Legion 7 keyboardDale A. Jackson2022-07-011-0/+7
| | | | | | Fixes disable-when-typing for the keyboard model on this laptop Signed-off-by: Dale A. Jackson <JacksonWrath@gmail.com>
* CODING_STYLE: update with a better description for variable assignmentsPeter Hutterer2022-06-291-15/+64
| | | | | | | | | | 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>
* gitlab CI: dnf remove gtk4-devel for the no-debug-gui deps jobPeter Hutterer2022-06-282-2/+2
| | | | | | | | 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>
* meson.build: fix build without WaylandPeter Hutterer2022-06-281-25/+24
| | | | | | | | | | | | 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 6a1bd5b0c9be55d21c6e066a94fc6fd77fea96ce Fixes #786 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: exclude the two high-delay debounce tests from the valgrind CI runsatrmb2022-06-281-2/+6
| | | | | | | | | | | | 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>
* meson.build: drop listing of header files from compilation targetsPeter Hutterer2022-06-161-37/+3
| | | | | | | | | | | | "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>
* gitlab CI: drop the manual meson to junit conversionPeter Hutterer2022-06-144-135/+4
| | | | | | | 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>
* libinput 1.21.01.21.0José Expósito2022-06-111-1/+1
| | | | Signed-off-by: José Expósito <jose.exposito89@gmail.com>
* gitlab CI: bump to F35 and F36, as well as Ubuntu 21.10 and 22.04Peter Hutterer2022-06-113-76/+81
| | | | | | | | 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>
* meson.build: check gtk targets before buildingPeter Hutterer2022-06-112-33/+41
| | | | | | | | | | | | | | 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>
* test: fix a typoPeter Hutterer2022-06-081-1/+1
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: use a ranged test instead of a duplicated onePeter Hutterer2022-06-081-38/+33
| | | | | | | 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>
* wheel: fix Lenovo Scrollpoint quirkJosé Expósito2022-06-075-3/+139
| | | | | | | | | | | | | | | | | 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: 6bb02aaf307a ("High-resolution scroll wheel support") Signed-off-by: José Expósito <jose.exposito89@gmail.com> Tested-by: Peter Ganzhorn <peter.ganzhorn@gmail.com>
* test: ensure we always have an axis event where we expect onePeter Hutterer2022-06-071-0/+1
| | | | | | | 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>
* test: fix the lowres-only wheel event testsPeter Hutterer2022-06-071-10/+5
| | | | | | | | | | | | These tests gave us false positives for devices without a REL_WHEEL or REL_HWHEEL because one of the helper functions papered over missing events. We have two tests here, one for horizontal, one for vertical but they mixed WHEEL and HWHEEL in both tests. Fix this by splitting them properly, so each test only checks that axis. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* filter-touchpad: normalize for dpi on the touchpad-specific flat profilesatrmb2022-05-291-6/+7
| | | | | | | | | | | | | | | | | | | | On mice, switching the acceleration profile to flat disables dpi normalization, because high or even switchable dpi are generally major features of a high-end mouse, and switching to flat acceleration indicates that the user wants to reduce the effects of any cursor acceleration to a minimum. Therefore we skip normalization there and let the user take full advantage of their expensive hardware. On touchpads, particularly those built into a laptop, users have to deal with whatever hardware they have; touchpad dpi is an afterthought at best, or a disaster at worst. Switching to the flat profile is more likely to be about avoiding the non-linear acceleration curve of the adaptive profile. Hence the flat profile for touchpads shouldn't copy what the one for mice does, but rather use dpi normalization like the adaptive profile. This keeps flat acceleration on low-resolution touchpads from dropping to unusably slow speeds. Signed-off-by: satrmb <10471-satrmb@users.noreply.gitlab.freedesktop.org>
* tablet: require a minimum pressure before we process pressure eventsPeter Hutterer2022-05-233-44/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tools default to 1% lower threshold (tip up) and 5% upper threshold (tip down). But our distance vs pressure exclusion would reset the distance for *any* pressure value, regardless how low that value was and how high distance was in comparison. A very low pressure value of less than 1% would then result in a normalized pressure of 0, so we'd effectively just reset the distance to zero and do nothing with the pressure. This can cause distance jumps when the tool arbitrarily sends low pressure values while hovering as seen in https://github.com/libsdl-org/SDL/pull/5481#issuecomment-1118969064 Commit 61bdc05fb0f84303f97daaba6ae6b49c976dbfbf from Dec 2017 "tablet: set the tip-up pressure threshold to 1%" was presumably to address this but no longer (?) works. Fix this by addressing multiple issues at the same time: - anything under that 1% threshold is now considered as zero pressure and any distance value is kept as-is. Once pressure reaches 1%, distance is always zero. - axis normalization is now from 1% to 100% (previously: upper threshold to 100%). So a tip down event should always have ~4% pressure and we may get tablet motion events with nonzero pressure before the tip down event. From memory, this was always intended anyway since a tip event should require some significant pressure, maybe too high compared to e.g. pressure-sensitive painting - where a tablet has an offset, add the same 1%/5% thresholds, on top of that offset. And keep adjusting those thresholds as we change the offset. Assuming that the offset is the absolute minimum a worn-out pen can reach, this gives us the same behaviour as a new pen. The calculation here uses a simple approach so the actual range is slightly larger than 5% but it'll do. Previously, the lower threshold for an offset pen was the axis minimum but that can never be reached. So there was probably an undiscovered bug in there. And fix a bunch of comments that were either wrong, confusing or incomplete, e.g. the pressure thresholds were already in device coordinates. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tablet: use a helper variable to make the code more readablePeter Hutterer2022-05-231-4/+5
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: rename a test function to make it easier to selectPeter Hutterer2022-05-231-2/+2
| | | | | | | Because --filter-test does substring matching it's easier to have it with a unique name rather than one that is a prefix of another. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tablet: remove an always-true part of an if conditionPeter Hutterer2022-05-231-2/+0
| | | | | | | | A few lines north of here we return early if neither bit is set. If we get to this point, at least one bit is set so this part of the condition always evaluates to true. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Remove "device-" fileJosé Expósito2022-05-181-0/+0
| | | | | | | | The file was unintentional added in a merge request: https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/771 Fixes: 4d26736e ("Quirk all StarLabs trackpads") Signed-off-by: José Expósito <jose.exposito89@gmail.com>
* Quirk all StarLabs trackpadsSean Rhodes2022-05-163-35/+6
| | | | | | | | | Quirk all the StarLabs trackpads as they are all the same design, a clickpad with physical buttons that act as one button. Fixes #771. Signed-off-by: Sean Rhodes <sean@starlabs.systems>
* quirks: remove an unused quirkPeter Hutterer2022-05-162-2/+0
| | | | | | | Removed in b925a0878b0b51fe30016546b9e48a7613dccd4d quirks: switch the models with missing buttonpad to use the new attr Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* quirks: move the canvas quirk enum to the right orderPeter Hutterer2022-05-162-2/+2
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* quirks: Add quirk for StarLite Mk IVSean Rhodes2022-05-091-0/+6
| | | | Signed-off-by: Sean Rhodes <sean@starlabs.systems>
* test: install libinput-test-utils as part of install-testsPeter Hutterer2022-05-093-2/+7
| | | | | | | | 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>
* tools: add a libinput test tool as entry point for our test suitesPeter Hutterer2022-05-095-0/+131
| | | | | | | | | | | | | We already install libinput-test-suite if the meson option install-tests is set, see commit be7045cdc70d8c026d981997852cc706dab3d5b8 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>
* tools/analyze-recording: improve the repeated-events line printingPeter Hutterer2022-05-061-3/+6
| | | | | | | | | | When redirecting to a file, we don't want lines like this: .. +2 ... +5 ... +9 Let's not print anything until we have collected all those lines and then print the final result, we don't need a live update here. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools/analyze-recording: add --print-state to always print valuesPeter Hutterer2022-05-061-2/+13
| | | | | | | | | | | Helpful in comparing values that update frequently - without this the last printed value may be way off the page when some other value comes in that it needs to be compared to. Values not seen yet default to zero - we can't query those from a recording but it'll be good enough this way. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools/record: fix indentation for libinput eventsPeter Hutterer2022-05-061-1/+4
| | | | | | | | | | | | | | Commit 0cdf459643bfa6264bd2d1af8f7749529ebffee1 tools/record: get rid of indent push/pop, replace with fixed indents Introduced some magic to detect if there's a '-' at the start of the format string to fix the identation. This only works if the format string is constant though, leading to an indentation error when record is run with --with-libinput. Fixes 0cdf459643bfa6264bd2d1af8f7749529ebffee1 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: don't print a carriage return if we're not on a ttyPeter Hutterer2022-05-041-1/+4
| | | | | | Otherwise redirecting the output to a file leaves us with ugly ^M Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: allow limiting the axes in libinput analyse recordingPeter Hutterer2022-05-041-5/+32
| | | | | | | | Use --ignore ABS_X,ABS_Y or --only ABS_X,ABS_Y to ignore or limit to only a specific axis set. Especially for tablet devices with their multitudes of axes this makes analysing a particular set easier. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* AttrLidSwitchReliability quirk default unreliable->reliableAlexander Courtis2022-04-268-24/+18
|
* 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>
* tools/record: fix the indentation of the system: sectionPeter Hutterer2022-04-071-1/+1
| | | | | | Fixes 0cdf459643bfa6264bd2d1af8f7749529ebffee1 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Update valgrind.h to a newer versionTom Stellard2022-04-051-53/+571
| | | | | | | | This updates valgrind.h to the version that was packaged in valgrind-devel-3.18.1-9.fc36. This new version contains a fix for a build failure with clang. Signed-off-by: Tom Stellard <tstellar@redhat.com>
* doc/user: add a page to troubleshoot right-click ClickpadsPeter Hutterer2022-03-284-1/+52
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* meson: replace a meson.source_root() with the explicit directoryPeter Hutterer2022-03-282-1/+2
| | | | | | Removes the warning that source_root() has been deprecated since 0.56.0 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* meson: fix a meson warningPeter Hutterer2022-03-281-1/+2
| | | | | | | | | | | run_command() wants a check kwarg now: WARNING: You should add the boolean check kwarg to the run_command call. It currently defaults to false, but it will default to true in future releases of meson. See also: https://github.com/mesonbuild/meson/issues/9300 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: disable hold gestures when are not requiredJosé Expósito2022-03-281-6/+3
| | | | | | | | | | Certain tests that make use of verify_left_handed_touch_motion can fail depending on how quick they are executed, specially when using Valgrind. Instead of ignoring the hold end event, use the existing mechanism to disable hold gestures where we are not interested in them. Signed-off-by: José Expósito <jose.exposito89@gmail.com>