platform/upstream/libinput.git
8 months agoFix issue detected by static analysis tool 75/297175/1 accepted/tizen_8.0_unified tizen_8.0 tizen_bkup_20231204 accepted/tizen/8.0/unified/20231005.095040 accepted/tizen/unified/20230814.121022 tizen_8.0_m2_release
Inhong Han [Fri, 11 Aug 2023 06:34:39 +0000 (15:34 +0900)]
Fix issue detected by static analysis tool

Change-Id: I8278954b483c0f7b848c3aa3468d14790605c147

9 months agolibinput.c: add logs for debugging in TIZEN 29/296129/1 accepted/tizen/unified/20230728.155757
duna.oh [Thu, 20 Jul 2023 07:03:37 +0000 (16:03 +0900)]
libinput.c: add logs for debugging in TIZEN

Change-Id: I0f5ad0fccf0c952af03e5ab4c829001f31312235

9 months agoFix issue detected by static analysis tool 31/295931/3 accepted/tizen/unified/20230726.163452
Jihoon Kim [Mon, 17 Jul 2023 09:56:53 +0000 (18:56 +0900)]
Fix issue detected by static analysis tool

Change-Id: If1b4102aabdb428771b2afc958af259cda8fb3b7
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
9 months agoFix issue detected by static analysis tool 01/295901/2
Jihoon Kim [Mon, 17 Jul 2023 04:56:38 +0000 (13:56 +0900)]
Fix issue detected by static analysis tool

Change-Id: I4dbabe8feab7a260260998f3f98fb9f532dc2fbd
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
14 months agopackaging: Bump up to 1.22.0 tizen_work_20230126 accepted/tizen/unified/20230227.152727
duna.oh [Fri, 27 Jan 2023 05:37:22 +0000 (14:37 +0900)]
packaging: Bump up to 1.22.0

14 months agohaltest: fix haltest ro run properly
duna.oh [Tue, 14 Feb 2023 08:37:36 +0000 (17:37 +0900)]
haltest: fix haltest ro run properly

- keyboard devices can have either ID_INPUT_KEY OR ID_INPUT_KEYBOARD
- keyboard_events
  : retrieve which keycode is available for the device and
  generate key event using available keycode
- touch_events
  : retrieve the ABS_MT_POSITION's resolution/max data from the device and
  validate touch events using these data

15 months agoevdev: resolve memory leak
duna.oh [Fri, 27 Jan 2023 07:26:43 +0000 (16:26 +0900)]
evdev: resolve memory leak

15 months agoevdev: A joystick could be ignored before opening input device
duna.oh [Tue, 12 Jul 2022 06:17:52 +0000 (15:17 +0900)]
evdev: A joystick could be ignored before opening input device

add checking if the builtin property 'ID_INPUT_JOYSTICK' is set.
Because 'LIBINPUT_IGNORE_DEVICE' is usually set by udev rule,
it may not be determined until the udev rule is parsed.

A joystick is not supported in libinput for now.

Change-Id: I19cc67538dd1ccc6f1c6f2a2dccbb96d344d40ac

15 months agotablet: Fix divide by zero error. 'count' could be zero
Duna Oh [Tue, 8 Feb 2022 06:39:18 +0000 (15:39 +0900)]
tablet: Fix divide by zero error. 'count' could be zero

15 months agopackagin: Bump up to 1.17.0
Duna Oh [Mon, 7 Feb 2022 16:31:41 +0000 (01:31 +0900)]
packagin: Bump up to 1.17.0

15 months agoChecking return value
dyamy-lee [Mon, 26 Apr 2021 06:13:30 +0000 (15:13 +0900)]
Checking return value

When using return value from other function, it is usually checked for it.

Change-Id: I071942d9885500ce37adf08f89788d59d031d458

15 months agoAdd Initialization of variable
dyamy-lee [Mon, 26 Apr 2021 05:05:42 +0000 (14:05 +0900)]
Add Initialization of variable

Add initialization for uninitialized pointer field.
Add initialization for uninitialized value of struct field.

Change-Id: I2faf84800bf54abdff4f18a1d920b1a162a07ad0

15 months agoResolve a resource leak
dyamy-lee [Mon, 26 Apr 2021 05:03:27 +0000 (14:03 +0900)]
Resolve a resource leak

fd going out of scope leaks the handle. So, it add close(fd) when it unfortunately return.

Change-Id: I00caca9166b30575503efbb41522bc2d5be8c2c4

15 months agoImplements TouchEventCheckTest for libinput haltests
dyamy-lee [Wed, 21 Apr 2021 08:01:49 +0000 (17:01 +0900)]
Implements TouchEventCheckTest for libinput haltests

It's same way of checking MouseEventCheckTest.
For test, get lists of libinput devices and check validation of created touch event.
Only different thing with others is check it is mult touch support.
It supports multi touch, it generates libiput touch event and saves sequencely. For example, touch down, move, up.
It checkes devices capability which is touch, and checkes matching of events. If one of them checked successfully same events as created events, other touch devices can be skipped.

Change-Id: I0a60e675c14714c67debd0cfaac3c9ed80a1dc03

15 months agoImplements KeyboardEventCheckTest for libinput haltests
dyamy-lee [Wed, 21 Apr 2021 07:48:43 +0000 (16:48 +0900)]
Implements KeyboardEventCheckTest for libinput haltests

It's same way of checking MouseEventCheckTest.
For test, get lists of libinput devices and check validation of created keyboard event.
It generates libinput keyboard event and saves sequencely. For example, key down, up, key down up.
It checkes devices capability which is keyboard, and checkes matching of events. If one of them checked successfully same events as created events, other keyboard devices can be skipped.

Change-Id: I8d20d9c324331c759bcce8a14096819b681e36ff

15 months agoImplements MouseEventCheckTest for libinput haltests
dyamy-lee [Wed, 21 Apr 2021 07:36:59 +0000 (16:36 +0900)]
Implements MouseEventCheckTest for libinput haltests

For test, get lists of libinput devices and check validation of created mouse event.
It generates libinput mouse event and saves sequencely. For example, mouse left button down, move, up.
It checkes devices capability which is mouse, and checkes matching of events. If one of them checked successfully same events as created events, other mouse devices can be skipped.

Change-Id: Ifa06d24d0796eb3b207dc30f13b924af1804a3e1

15 months agoAdd testing get libinput devices list for libinput haltests
dyamy-lee [Wed, 21 Apr 2021 07:08:45 +0000 (16:08 +0900)]
Add testing get libinput devices list for libinput haltests

For saving libinput devices list, create struct about device info(Capability, path) and function for handling libinput add event.
It only saves real devices. It means, it skips uinput device and checks property of udev device.

Change-Id: Ibf42abe728c550e40da13897c02b8abdc7235baa

15 months agoAdd SetUp/TearDown in libinput haltests
dyamy-lee [Wed, 21 Apr 2021 06:44:40 +0000 (15:44 +0900)]
Add SetUp/TearDown in libinput haltests

Every test creates libinput and udev, and removes them. So, executing common logic as using SetUp/TearDown.

Change-Id: I445db460c282a6f929ac8db5a70c0aa67302f32a

15 months agoAdd libinput haltests frame
dyamy-lee [Wed, 21 Apr 2021 06:35:11 +0000 (15:35 +0900)]
Add libinput haltests frame

It generate the libinput haltests rpm package successfullty for testing input devices in hal by adding build configuration and packaging configuration.
It test udev create, first. And it will be implement each device types test later.

Change-Id: I86312d798503b1816c2826df35590031d1d2305a

15 months agopackaging: Bump up to 1.16.1
jeon [Wed, 6 Jan 2021 06:50:29 +0000 (15:50 +0900)]
packaging: Bump up to 1.16.1

Change-Id: Iae16b868b7d372db197e3e4197d7d6f22f37b345

15 months agoFix indentation
INSUN PYO [Mon, 16 Nov 2020 04:57:44 +0000 (13:57 +0900)]
Fix indentation

Change-Id: I957b966407ec281bb7b91cd7ed2dc49e8a3c3802

15 months agoudev-seat: skip addition of unconfigured device by event source
Sung-Jin Park [Tue, 27 Oct 2020 12:07:50 +0000 (21:07 +0900)]
udev-seat: skip addition of unconfigured device by event source

Change-Id: Id7f36e62ca6f566d8b2023daa39480c6d6a9a568
Signed-off-by: Sung-Jin Park <sj76.park@samsung.com>
15 months agoflush touch aux events without normal touch events
jeon [Wed, 17 Jun 2020 12:57:18 +0000 (21:57 +0900)]
flush touch aux events without normal touch events

Change-Id: I1a249c253a0f760b523c56cd73d3daa76a2eac0b

15 months agolibinput: remove build warnings
jeon [Thu, 12 Mar 2020 11:55:44 +0000 (20:55 +0900)]
libinput: remove build warnings

  - if ENABLE_QUIRKS is not enabled,
    these variables are not used.

Change-Id: Ie909526d2dc18b47d8b527a141ea59092bb8ade2

15 months agoudev-seat: fix a memory leak
jeon [Thu, 12 Mar 2020 10:44:25 +0000 (19:44 +0900)]
udev-seat: fix a memory leak

Change-Id: Ic6aff8a80c272da3510d611c0fc31f4ace73fbaf

15 months agoquirks: add an option to enable/disable quirks
jeon [Thu, 12 Mar 2020 10:18:00 +0000 (19:18 +0900)]
quirks: add an option to enable/disable quirks

Change-Id: I75aef0d1b1f98b4e2491c9197d1cf8ad54c59341

15 months agopackaging: Bump up to 1.15.0
jeon [Tue, 18 Feb 2020 11:35:25 +0000 (20:35 +0900)]
packaging: Bump up to 1.15.0

15 months agoevdev: fix a memory leak
jeon [Thu, 9 Jan 2020 08:38:16 +0000 (17:38 +0900)]
evdev: fix a memory leak

Change-Id: Id19e03cb517286e2b7e2c127a162195f3c65726b

15 months agoevdev: filtering a BTN_TOOL_FINGER like a BTN_TOUCH
jeon [Fri, 3 May 2019 11:20:25 +0000 (20:20 +0900)]
evdev: filtering a BTN_TOOL_FINGER like a BTN_TOUCH

Change-Id: Iebf445657df1c3028d816f3d5ca5a925a2c571f5

15 months agoevdev: free aux_data struct in fallback destroy function
JengHyun Kang [Fri, 12 Oct 2018 07:00:46 +0000 (16:00 +0900)]
evdev: free aux_data struct in fallback destroy function

Change-Id: Ief8b7ed7bf1aea714e635ca2661450b519012015

15 months agoudev-seat: add apis to set udev monitor's event source and buffer size
Sung-Jin Park [Mon, 20 Aug 2018 07:21:43 +0000 (16:21 +0900)]
udev-seat: add apis to set udev monitor's event source and buffer size

Change-Id: Ib41e5421c174e2d5cc26bc19f077a045ad7a2e19
Signed-off-by: Sung-Jin Park <sj76.park@samsung.com>
15 months agoudev-seat: remove unused environment variable
Sung-Jin Park [Mon, 20 Aug 2018 05:18:06 +0000 (14:18 +0900)]
udev-seat: remove unused environment variable

Change-Id: I97fa9f2fe29875dcefa3f642f6ecad695d11c555
Signed-off-by: Sung-Jin Park <sj76.park@samsung.com>
15 months agoevdev: support ABS_MT_PRESSURE events
JengHyun Kang [Fri, 6 Jul 2018 06:19:48 +0000 (15:19 +0900)]
evdev: support ABS_MT_PRESSURE events

Change-Id: I9f7a4d4f6b463a396a3848059990b1a1f2174d23

15 months agolibinput-udev: fix not to install udev rules and utils
Sung-Jin Park [Wed, 21 Mar 2018 08:49:30 +0000 (17:49 +0900)]
libinput-udev: fix not to install udev rules and utils

Change-Id: Ied11493e151a17407c79cd7d88fb84c2132f3ec9
Signed-off-by: Sung-Jin Park <sj76.park@samsung.com>
15 months agoudev-seat: add LIBINPUT_UDEV_SKIP_INITIAL_ENUMERATION env to enable skip udev enumeration
Sung-Jin Park [Fri, 22 Dec 2017 02:58:49 +0000 (11:58 +0900)]
udev-seat: add LIBINPUT_UDEV_SKIP_INITIAL_ENUMERATION env to enable skip udev enumeration

Change-Id: Id88d21e8d4c40d7d5a85fb68c4bbaef4dc56e7d0
Signed-off-by: Sung-Jin Park <sj76.park@samsung.com>
15 months agolibinput-util: fix logical error regarding comparison of a long variable with its...
Sung-Jin Park [Mon, 13 Nov 2017 05:10:53 +0000 (14:10 +0900)]
libinput-util: fix logical error regarding comparison of a long variable with its maximum/minimum value

Change-Id: I9d6451a645476efb85477e6e4a9807ea136c05b4
Signed-off-by: Sung-Jin Park <sj76.park@samsung.com>
15 months agoevdev: fix integer division problem by casting one of two integers as double
Sung-Jin Park [Mon, 13 Nov 2017 06:39:40 +0000 (15:39 +0900)]
evdev: fix integer division problem by casting one of two integers as double

Change-Id: Ice7caf41c4834b625825335c37e14266c31f5cc4
Signed-off-by: Sung-Jin Park <sj76.park@samsung.com>
15 months agofix build warnings
JengHyun Kang [Wed, 25 Oct 2017 08:02:39 +0000 (17:02 +0900)]
fix build warnings

15 months agopackaging: Bump up to 1.8.0
JengHyun Kang [Tue, 24 Oct 2017 07:39:33 +0000 (16:39 +0900)]
packaging: Bump up to 1.8.0

Change-Id: I4530bc57d1cbc9d9441f95e2e68c944ad7210794

15 months agoevdev: check a null list
JengHyun Kang [Tue, 5 Sep 2017 12:54:07 +0000 (21:54 +0900)]
evdev: check a null list

Change-Id: Ic281e4ff5f266bff9638f204964cc2503c7d90c8

15 months agolibinput-device-group: apply ASLR
Sung-Jin Park [Fri, 11 Aug 2017 07:34:55 +0000 (16:34 +0900)]
libinput-device-group: apply ASLR

Change-Id: I517dde04ad048cace459d23f3df63d8deb26c5c6
Signed-off-by: Sung-Jin Park <sj76.park@samsung.com>
15 months agoevdev: casting unsigned int to int to compare value
JengHyun Kang [Wed, 7 Jun 2017 11:20:56 +0000 (20:20 +0900)]
evdev: casting unsigned int to int to compare value

Change-Id: I3c1a3da814b89af44e3d6e93bbad2cc7c2535b70

15 months agoevdev: free aux_data list when device is destroy
JengHyun Kang [Wed, 7 Jun 2017 11:10:07 +0000 (20:10 +0900)]
evdev: free aux_data list when device is destroy

Change-Id: I76f8df6b8fed1d01540c1430247ffc00dc28dfc5

15 months agoevdev: remove unreachable code and add exception handling code for aux_data_list
Sung-Jin Park [Tue, 30 May 2017 06:53:19 +0000 (15:53 +0900)]
evdev: remove unreachable code and add exception handling code for aux_data_list

Change-Id: I7e2a936cece97d7a8ecce90fa261976514e35371
Signed-off-by: Sung-Jin Park <sj76.park@samsung.com>
15 months agosupport a AUX code events generated from EV_ABS
JengHyun Kang [Tue, 25 Apr 2017 09:51:02 +0000 (18:51 +0900)]
support a AUX code events generated from EV_ABS

Change-Id: I144282f5ddc330eb77b73b3da5a36cedb6af069f

15 months agoImport opensource codes for security issue. - evdev: user safe_atod to convert the...
JengHyun Kang [Mon, 17 Apr 2017 09:54:11 +0000 (18:54 +0900)]
Import opensource codes for security issue. - evdev: user safe_atod to convert the matrix values

Change-Id: I140c95ca030822bf6345b09d16d445af0aebd9e5

15 months agopackaging: update packaging file to install license file via %license macro
Sung-Jin Park [Wed, 22 Mar 2017 05:27:02 +0000 (14:27 +0900)]
packaging: update packaging file to install license file via %license macro

Change-Id: I65ccb6a6357abf1a9ea060ca8c1eb3abf077d955
Signed-off-by: Sung-Jin Park <sj76.park@samsung.com>
15 months agoIgnore joystick devices if LIBINPUT_IGNORE_JOYSTICK env is 1
JengHyun Kang [Fri, 9 Dec 2016 02:51:58 +0000 (11:51 +0900)]
Ignore joystick devices if LIBINPUT_IGNORE_JOYSTICK env is 1

Change-Id: I56d9cc833acad212e3d8071a79adf27bc29c19ca

15 months agoevdev: Do not open the already opened device
JengHyun Kang [Mon, 22 Aug 2016 07:54:29 +0000 (16:54 +0900)]
evdev: Do not open the already opened device

Change-Id: I96ba5287f28dfa301628232a5a6a02f1baf1c7a2

15 months agoSet receive buffer size from UDEV_MONITOR_BUFFER_SIZE env
Lisa kim [Fri, 29 Jul 2016 06:55:54 +0000 (15:55 +0900)]
Set receive buffer size from UDEV_MONITOR_BUFFER_SIZE env

Change-Id: I6adaa345ad4df6f1c3c26811b569cb0998bf0bc8
Signed-off-by: Lisa kim <hj0530.kim@samsung.com>
15 months agoCall a input_set_default_property() in evdev_device_create if this function is exist
JengHyun Kang [Tue, 12 Jul 2016 08:52:27 +0000 (17:52 +0900)]
Call a input_set_default_property() in evdev_device_create if this function is exist

Change-Id: Ib47c6115248204d9ff63ced802c557b1bf5ad5f5

15 months agosvace: Modify a strerror function to strerror_r to gurantee threads safety.
JengHyun Kang [Tue, 12 Jul 2016 02:14:03 +0000 (11:14 +0900)]
svace: Modify a strerror function to strerror_r to gurantee threads safety.

Change-Id: Iacd31adb29bb284f93aa04597d5c6ca364e0616b

15 months agoAdd a device only when the device is not created by libinput_path
Duna Oh [Mon, 18 Apr 2016 13:56:59 +0000 (22:56 +0900)]
Add a device only when the device is not created by libinput_path

Signed-off-by: Duna Oh <duna.oh@samsung.com>
Change-Id: Ic9d444cbf0d8ab95293e3770a91e31e83f405d60

15 months agoAdd a new API to return wheel click angle value
JengHyun Kang [Thu, 24 Mar 2016 11:50:02 +0000 (20:50 +0900)]
Add a new API to return wheel click angle value

Change-Id: Ic45f60fd95ab7835fa92064c9badb46fe9164695

15 months agoApply directory macros
Sung-Jin Park [Fri, 11 Mar 2016 02:50:46 +0000 (11:50 +0900)]
Apply directory macros

Change-Id: I9b419f585ef8b1832fcc114720fc572869771ce3

15 months agoModify a ttrace macro name TRACE_BEGIN to TRACE_INPUT_BEGIN
JengHyun Kang [Fri, 26 Feb 2016 08:40:45 +0000 (17:40 +0900)]
Modify a ttrace macro name TRACE_BEGIN to TRACE_INPUT_BEGIN

Change-Id: I2559a8156056fcbd359008e0da59615ff7270c7d

15 months agoRemove unnecessary ttrace and add ttrace logs to another point
JengHyun Kang [Wed, 24 Feb 2016 05:03:27 +0000 (14:03 +0900)]
Remove unnecessary ttrace and add ttrace logs to another point

Change-Id: I21c3d60d357c46df968437e22f45dcf12455ff6c

15 months agoAdd ttrace
JengHyun Kang [Thu, 11 Feb 2016 06:44:36 +0000 (15:44 +0900)]
Add ttrace

Change-Id: I82a316d226c967a396f6ce5671feeafbfb37bd0f

15 months agoAdd a patch for support extra touch events.
JengHyun Kang [Thu, 7 Jan 2016 08:23:24 +0000 (17:23 +0900)]
Add a patch for support extra touch events.

  - libinput commit name: add orientation and size of touch point and pressure to the API

Change-Id: Icfd09c132b51bf15837f11bdd662181e666960b5

15 months agoAdd manifest for security domain policy
Mun, Gwan-gyeong [Tue, 4 Aug 2015 08:03:30 +0000 (17:03 +0900)]
Add manifest for security domain policy

Change-Id: I70e41f3e4ad12035ff513fc2a322bedbaf87dd49

15 months agopackaging: correct installation path of udev rule files on 64bit arch
Gwanglim Lee [Mon, 11 May 2015 05:27:56 +0000 (14:27 +0900)]
packaging: correct installation path of udev rule files on 64bit arch

Change-Id: I26ae6192c393516e18d72b1fedc0aa1c412f164b

15 months agopackaging: Bump to 0.11.0
Philippe Coval [Mon, 23 Feb 2015 09:05:08 +0000 (10:05 +0100)]
packaging: Bump to 0.11.0

Change-Id: I68ab7b18613657814e6535261ac85fad4019122a
Signed-off-by: Philippe Coval <philippe.coval@open.eurogiciel.org>
15 months agopackaging: Bump to 0.8.0
Manuel Bachmann [Sat, 14 Feb 2015 15:10:57 +0000 (16:10 +0100)]
packaging: Bump to 0.8.0

Change-Id: I661837a5368f60aeeb0760c1f419fd3c457faf31
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
15 months agopackaging: Bump to 0.6.0
Philippe Coval [Tue, 4 Nov 2014 15:31:28 +0000 (16:31 +0100)]
packaging: Bump to 0.6.0

Change-Id: Id66ecfc8dec24521687a572b699d0606b29ff4dc
Signed-off-by: Philippe Coval <philippe.coval@open.eurogiciel.org>
15 months agopackaging: Bump to 0.5.0
Philippe Coval [Thu, 14 Aug 2014 12:46:53 +0000 (14:46 +0200)]
packaging: Bump to 0.5.0

Change-Id: Icc00f5164583a5657e7699a686c76e49698093f2
Signed-off-by: Philippe Coval <philippe.coval@open.eurogiciel.org>
15 months agopackaging: use upstream tags
Philippe Coval [Thu, 14 Aug 2014 12:46:23 +0000 (14:46 +0200)]
packaging: use upstream tags

Change-Id: Ia5af4a9a3294e3359dd67f635be1c0e97a416387
Signed-off-by: Philippe Coval <philippe.coval@open.eurogiciel.org>
15 months agopackaging: Initial packaging on 0.1.0 for Tizen
Philippe Coval [Fri, 28 Feb 2014 15:46:59 +0000 (16:46 +0100)]
packaging: Initial packaging on 0.1.0 for Tizen

Change-Id: I682fc2715f9f8a60046c5c9297b7d96173131aeb
Signed-off-by: Philippe Coval <philippe.coval@open.eurogiciel.org>
17 months agolibinput 1.22.0 upstream_bkup_20240104 upstream_work_20230126 1.22.0 upstream/1.22.0
José Expósito [Sat, 19 Nov 2022 11:21:06 +0000 (12:21 +0100)]
libinput 1.22.0

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
17 months agogitlab CI: pre-install all packages we need
Peter Hutterer [Fri, 1 Jul 2022 04:40:20 +0000 (14:40 +1000)]
gitlab CI: pre-install all packages we need

Running "dnf install" during a job can lead to issues when the image is
old - package renames/replacements/etc. may require a dnf upgrade to get
those packages sorted first before our dnf install works.

This hasn't been a problem for us because we had weekly rebuilds of the
images scheduled and were usually on the latest package set but let's do
this properly anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
17 months agogitlab CI: update freebsd to 13.1
Peter Hutterer [Tue, 15 Nov 2022 22:33:51 +0000 (08:33 +1000)]
gitlab CI: update freebsd to 13.1

This gets rid of of the following error:
  ld-elf.so.1: /lib/libc.so.7: version FBSD_1.7 required by /usr/local/lib/libpython3.9.so.1.0 not found

Too tired to debug what is really going on, so let's pretend the update
is the best way to fix this.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
17 months agogitlab CI: don't install valgrind, it's already in the template
Peter Hutterer [Fri, 1 Jul 2022 04:33:17 +0000 (14:33 +1000)]
gitlab CI: don't install valgrind, it's already in the template

This has been a noop for quite a while, so we might as well skip it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
17 months agotouchpad: add escape and asterisk to the DWT blacklist
José Expósito [Mon, 14 Nov 2022 17:38:13 +0000 (18:38 +0100)]
touchpad: add escape and asterisk to the DWT blacklist

The escape key can be used to cancel a drag and drop action in some
desktop environments. However, it triggers disable-while-typing, ending
the drag and drop action rather than cancelling it.

Add it to the tp_key_ignore_for_dwt() set to avoid it.

Since I'm here, add the asterisk key as it is the only numpad key not
ignored by tp_key_ignore_for_dwt().

Fix: https://gitlab.freedesktop.org/libinput/libinput/-/issues/820  # [1]
Suggested-by: satrmb <10471-satrmb@users.noreply.gitlab.freedesktop.org>
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
17 months agoutil: use ck_assert_ptr_eq() instead of ck_assert_ptr_null()
José Expósito [Mon, 14 Nov 2022 18:06:07 +0000 (19:06 +0100)]
util: use ck_assert_ptr_eq() instead of ck_assert_ptr_null()

The ck_assert_ptr_null() function is not available in the version of
the check library included in 20.04 LTS Focal (0.10.0).

Use ck_assert_ptr_eq() to avoid compilation errors.

Fixes: eeae8906dbbb ("util: return the number of elements from strv_from_string")
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
17 months agoutil: return the number of elements from strv_from_string
Yinon Burgansky [Wed, 5 Oct 2022 15:20:06 +0000 (18:20 +0300)]
util: return the number of elements from strv_from_string

Signed-off-by: Yinon Burgansky <51504-Yinon@users.noreply.gitlab.freedesktop.org>
18 months agodebug-gui: avoid locking pointer twice
José Expósito [Mon, 10 Oct 2022 06:14:55 +0000 (08:14 +0200)]
debug-gui: avoid locking pointer twice

On Sway, and probably other Wayland compositors based on wlroots, the
window_lock_pointer() was called twice.

Avoid errors when window_lock_pointer() is invoked multiple times.

Fix https://gitlab.freedesktop.org/libinput/libinput/-/issues/808
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
18 months agotools: hide debug-gui help when building with -Ddebug-gui=false
José Expósito [Mon, 10 Oct 2022 06:27:05 +0000 (08:27 +0200)]
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>
18 months agomeson.build: always set HAVE_GTK_WAYLAND
José Expósito [Sun, 9 Oct 2022 18:07:59 +0000 (20:07 +0200)]
meson.build: always set HAVE_GTK_WAYLAND

In commit 6a1bd5b0c9be ("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>
19 months agotablet: avoid errors calling libevdev_get_abs_info()
José Expósito [Mon, 3 Oct 2022 10:53:22 +0000 (12:53 +0200)]
tablet: avoid errors calling libevdev_get_abs_info()

Commit 806d4a1393db ("tablet: check libevdev_get_abs_info() return
value") prevented a crash when tilt was deactivated by a quirk.
For more information check [1].

Add similar checks before calling libevdev_get_abs_info() to avoid
possible crashes.

[1] https://gitlab.freedesktop.org/libinput/libinput/-/issues/805
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
19 months agoFix Framework quirk so it wirks with 12 gen intel
Tadhg McDonald-Jensen [Fri, 23 Sep 2022 16:26:36 +0000 (12:26 -0400)]
Fix Framework quirk so it wirks with 12 gen intel

Removes a colon from frameworks quirks dmi match
so it matches pnLaptop(12thGenIntelCore) on newer model

Signed-off-by: Tadhg McDonald-Jensen <tadhgmister@gmail.com>
19 months agotablet: check libevdev_get_abs_info() return value
José Expósito [Mon, 12 Sep 2022 16:28:38 +0000 (18:28 +0200)]
tablet: check libevdev_get_abs_info() return value

Commit b5f0536a4f93 ("quirks: add a quirk for the Wacom 524c device")
added the quirk "AttrEventCodeDisable=ABS_TILT_X;ABS_TILT_Y;" to the
Wacom 524c.

When using the pen in a display with tilt support, the tilt X/Y axes
are set as changed. Using the pen again, but this time in the display
without tilt support, will try to get the tilt information, crashing.

Check the return value of libevdev_get_abs_info() to avoid this crash.

Fix https://gitlab.freedesktop.org/libinput/libinput/-/issues/805
Fixes: b5f0536a4f93 ("quirks: add a quirk for the Wacom 524c device")
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
19 months agofilter: add a flat trackpoint accel
Peter Hutterer [Mon, 5 Sep 2022 01:33:57 +0000 (11:33 +1000)]
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>
19 months agofilter: apply the same factor for constant motion as for normal motion
Peter Hutterer [Sun, 4 Sep 2022 23:56:16 +0000 (09:56 +1000)]
filter: apply the same factor for constant motion as for normal motion

Users that want a flat pointer acceleration want the input speed to
match 1:1 to the output speed, barring a fixed constant multiplier.
This will apply to things like button scrolling as well, so let's map
the constant accel function to the non-constant accel functions to the
speed setting applies to every movement.

This is applied to both the flat and the touchpad flat filter.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
19 months agofilter: don't normalize the speed again in the default mouse filter
Peter Hutterer [Sun, 4 Sep 2022 23:46:54 +0000 (09:46 +1000)]
filter: don't normalize the speed again in the default mouse filter

The first thing this filter does is normalize the coordinates to
1000dpi, i.e. all other values are in normalized coordinates.

By normalizing the speed again we get an invalid value, effectively
stretching or compressing the acceleration curve. e.g. on a 5000dpi
mouse the estimated speed was 1/5 of the real speed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
19 months agoevdev: use filter_dispatch_constant() for the lenovo trackpoint "wheel"
Peter Hutterer [Sun, 4 Sep 2022 23:26:21 +0000 (09:26 +1000)]
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>
19 months agoevdev: use filter_dispatch_constant() for button scrolling
Peter Hutterer [Sun, 4 Sep 2022 23:26:21 +0000 (09:26 +1000)]
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>
19 months agofilter: don't normalize the const filter approach
Peter Hutterer [Sun, 4 Sep 2022 23:35:23 +0000 (09:35 +1000)]
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>
19 months agofilter: constify the interfaces and make them static
Peter Hutterer [Mon, 5 Sep 2022 01:33:20 +0000 (11:33 +1000)]
filter: constify the interfaces and make them static

No functional change

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
19 months agoevdev: rename post_trackpoint_scroll to post_button_scroll
Peter Hutterer [Sun, 4 Sep 2022 23:15:39 +0000 (09:15 +1000)]
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>
19 months agofilter: localize a few variables
Peter Hutterer [Sun, 4 Sep 2022 22:48:12 +0000 (08:48 +1000)]
filter: localize a few variables

No functional changes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
19 months agofilter: constify the tracker API
Peter Hutterer [Fri, 2 Sep 2022 04:53:45 +0000 (14:53 +1000)]
filter: constify the tracker API

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
19 months agofilter: remove an unnecessary layer of indirection
Peter Hutterer [Fri, 2 Sep 2022 04:34:56 +0000 (14:34 +1000)]
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>
19 months agofilter: fix the mix of normalized vs device coordinates
Peter Hutterer [Fri, 2 Sep 2022 04:23:04 +0000 (14:23 +1000)]
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>
19 months agofilter: a few whitespace fixes and extra comments
Peter Hutterer [Fri, 2 Sep 2022 04:18:26 +0000 (14:18 +1000)]
filter: a few whitespace fixes and extra comments

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
20 months agoCI: drop the job count for the valgrind test suite to 2
Peter Hutterer [Thu, 1 Sep 2022 00:57:45 +0000 (10:57 +1000)]
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>
20 months agoCI: in b2c, compile on the host, then test in qemu
Benjamin Tissoires [Thu, 11 Aug 2022 05:19:14 +0000 (07:19 +0200)]
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>
20 months agoCI: start a full systemd environment before running the testsuite
Benjamin Tissoires [Thu, 5 Aug 2021 13:17:27 +0000 (15:17 +0200)]
CI: start a full systemd environment before running the testsuite

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
20 months agoCI: include systemd-udev in the fedora image
Benjamin Tissoires [Fri, 30 Jul 2021 10:05:01 +0000 (12:05 +0200)]
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>
20 months agoCI: rely on b2c to start qemu tests
Benjamin Tissoires [Fri, 30 Jul 2021 09:30:32 +0000 (11:30 +0200)]
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>
20 months agoCI: do not retry the qemu runs
Benjamin Tissoires [Fri, 30 Jul 2021 10:06:40 +0000 (12:06 +0200)]
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>
20 months agoCI: remove unused test
Benjamin Tissoires [Fri, 30 Jul 2021 09:28:41 +0000 (11:28 +0200)]
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>