Commit graph

13 commits

Author SHA1 Message Date
José Expósito
71f79b9de1 libwacom: fix warnings building without libwacom
When the libwacom build option is set to false the compiler throws
these warnings:

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

Add the required guards to fix the warnings.

Fix #791.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2022-07-12 19:44:59 +02:00
luokai
87447a0ee9 using secure functions safe_strdup
Signed-off-by: luokai <l18674732394.com>
2021-06-15 11:27:29 +08:00
Peter Hutterer
5201ed8cc6 meson.build: update libwacom dependency to 0.27 or newer
Released in 2017, that's enough waiting

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-09-09 12:36:09 +10:00
Peter Hutterer
8040f94637 udev: directly import the device groups
No need for the indirection of PROGRAM, then ENV for the output value.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-12 19:23:36 +10:00
Peter Hutterer
8a75da773e udev: fix potential memory leak for the phys string
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-10-24 14:27:37 +10:00
Jason Gerecke
5521ab03f4 udev: Reproduce entire LIBINPUT_DEVICE_GROUP for paired ExpressKey Remote
In order for two devices to be in the same group, they need to share
identical LIBINPUT_DEVICE_GROUP attributes. The `wacom_handle_ekr` function
overwrites the VID/PID for an ExpressKey Remote, but the 'phys' path is
left unchanged. This only works if the EKR and the device we want to pair
it with are both direct sibings in the USB tree. It isn't always possible
to actually connect the devices like this, however. The Cintiq Pro 32 and
24, for instance, have multiple internal USB hubs and place the pen sensor
and the USB port for the EKR dongle behind different ones.

By copying the 'phys' path of the device we want to pair with, it is
possible to reproduce the entire LIBINPUT_DEVICE_GROUP and ensure that
the two devices actually end up paired in libinput.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
2019-07-29 22:38:36 +00:00
Peter Hutterer
da94e4e603 Silence coverity warning about uninitialized entry
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-02-16 16:57:30 +10:00
Benjamin Tissoires
57c5a409d6 udev: drop the version field in device groups
The version field is a per device information. We have
no guarantees a touchscreen and a tablet device will share
the same version of the firmware (especially if both
firmwares are from different vendors).

Fixes the touch arbitration for the Dell Canvas 27

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-10-26 18:25:54 +10:00
Peter Hutterer
c44c028678 udev: move the EKR into the parent's device group
If we find an EKR, search for the usb hub of the Cintiq, then find the Cintiq
Pen (or Touch) device and assume that device's product id. This way we end up
in the same device group as the Cintiq.

Co-authored-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-07 08:59:20 +10:00
Peter Hutterer
8a8c72983f udev: check wacom devices for a paired product id
The newer Wacom Cintiqs have touch devices with a different PID than the pen
device. Use the new libwacom_get_paired_device call where available to pair
the two devices and give them the same device group.

This isn't that important just yet, so no need to force users to update to a
new libwacom version.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-08-03 14:06:48 +10:00
Peter Hutterer
7cd6f9780d Add missing copyright header to the udev callout
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-30 13:32:14 +10:00
Peter Hutterer
b1fc392268 udev: prepend the libinput group with the product string
Multiple devices plugged into the same USB hub have the same
PHYS path and are assigned to the same group.

Prepend the content of the PRODUCT env to the phys path, this at least ensures
that different devices are never grouped together.

https://bugs.freedesktop.org/show_bug.cgi?id=89802

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-06-23 09:07:44 +10:00
Peter Hutterer
2b2a1b0eb9 Add udev bits to assign LIBINPUT_DEVICE_GROUP
The easiest way to get a device group is by looking at the phys path of the
input device (which looks like usb-0000:00:14.0-1/input1) and dropping the
/inputX bit. The rest is the same for devices that belong together (except on
the Cintiq 22HD Touch).

Ideally we could just take ATTRS{phys} but we can't select substrings to drop
into ENV so we need to do it ourselves. This patch adds a callout that takes a
syspath and prints the mangled path, to be used in LIBINPUT_DEVICE_GROUP.

The rule triggers on any device that has a non-zero phys attribute, this
groups devices like tablets together but also devices like mice with multiple
interfaces.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-02-18 10:08:29 +10:00