mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-06 04:28:22 +02:00
path: store the sysname, not the syspath, in the device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
This commit is contained in:
parent
05fc927168
commit
5d7e0fbfec
1 changed files with 7 additions and 7 deletions
14
src/path.c
14
src/path.c
|
|
@ -75,7 +75,7 @@ path_seat_create(struct path_input *input,
|
||||||
|
|
||||||
static int
|
static int
|
||||||
path_get_udev_properties(const char *path,
|
path_get_udev_properties(const char *path,
|
||||||
char **syspath,
|
char **sysname,
|
||||||
char **seat_name,
|
char **seat_name,
|
||||||
char **seat_logical_name)
|
char **seat_logical_name)
|
||||||
{
|
{
|
||||||
|
|
@ -96,7 +96,7 @@ path_get_udev_properties(const char *path,
|
||||||
if (!device)
|
if (!device)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
*syspath = strdup(udev_device_get_syspath(device));
|
*sysname = strdup(udev_device_get_sysname(device));
|
||||||
|
|
||||||
seat = udev_device_get_property_value(device, "ID_SEAT");
|
seat = udev_device_get_property_value(device, "ID_SEAT");
|
||||||
*seat_name = strdup(seat ? seat : default_seat);
|
*seat_name = strdup(seat ? seat : default_seat);
|
||||||
|
|
@ -121,7 +121,7 @@ path_input_enable(struct libinput *libinput)
|
||||||
struct path_seat *seat;
|
struct path_seat *seat;
|
||||||
struct evdev_device *device;
|
struct evdev_device *device;
|
||||||
const char *devnode = input->path;
|
const char *devnode = input->path;
|
||||||
char *syspath;
|
char *sysname;
|
||||||
int fd;
|
int fd;
|
||||||
char *seat_name, *seat_logical_name;
|
char *seat_name, *seat_logical_name;
|
||||||
|
|
||||||
|
|
@ -134,10 +134,10 @@ path_input_enable(struct libinput *libinput)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (path_get_udev_properties(devnode, &syspath,
|
if (path_get_udev_properties(devnode, &sysname,
|
||||||
&seat_name, &seat_logical_name) == -1) {
|
&seat_name, &seat_logical_name) == -1) {
|
||||||
close_restricted(libinput, fd);
|
close_restricted(libinput, fd);
|
||||||
log_info("failed to obtain syspath for device '%s'.\n", devnode);
|
log_info("failed to obtain sysname for device '%s'.\n", devnode);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -145,8 +145,8 @@ path_input_enable(struct libinput *libinput)
|
||||||
free(seat_name);
|
free(seat_name);
|
||||||
free(seat_logical_name);
|
free(seat_logical_name);
|
||||||
|
|
||||||
device = evdev_device_create(&seat->base, devnode, syspath, fd);
|
device = evdev_device_create(&seat->base, devnode, sysname, fd);
|
||||||
free(syspath);
|
free(sysname);
|
||||||
libinput_seat_unref(&seat->base);
|
libinput_seat_unref(&seat->base);
|
||||||
|
|
||||||
if (device == EVDEV_UNHANDLED_DEVICE) {
|
if (device == EVDEV_UNHANDLED_DEVICE) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue