Commit 07860e5d authored by Peter Hutterer's avatar Peter Hutterer

path: parse the WL_OUTPUT property for patch devices too

Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent d8b5957d
......@@ -116,7 +116,7 @@ path_device_enable(struct path_input *input,
struct path_seat *seat;
struct evdev_device *device = NULL;
char *seat_name = NULL, *seat_logical_name = NULL;
const char *seat_prop;
const char *seat_prop, *output_name;
const char *devnode;
devnode = udev_device_get_devnode(udev_device);
......@@ -169,6 +169,9 @@ path_device_enable(struct path_input *input,
}
evdev_read_calibration_prop(device);
output_name = udev_device_get_property_value(udev_device, "WL_OUTPUT");
if (output_name)
device->output_name = strdup(output_name);
out:
free(seat_name);
......
......@@ -82,7 +82,8 @@ static const char udev_rule[] =
"KERNEL!=\"event*\", GOTO=\"calibrated_touchscreen_end\"\n"
"\n"
"ATTRS{name}==\"litest Calibrated Touchscreen*\",\\\n"
" ENV{LIBINPUT_CALIBRATION_MATRIX}=\"1.2 3.4 5.6 7.8 9.10 11.12\"\n"
" ENV{LIBINPUT_CALIBRATION_MATRIX}=\"1.2 3.4 5.6 7.8 9.10 11.12\",\\\n"
" ENV{WL_OUTPUT}=\"myOutput\"\n"
"\n"
"LABEL=\"calibrated_touchscreen_end\"";
......
......@@ -1549,6 +1549,28 @@ START_TEST(device_has_no_size)
}
END_TEST
START_TEST(device_get_output)
{
struct litest_device *dev = litest_current_device();
struct libinput_device *device = dev->libinput_device;
const char *output_name;
output_name = libinput_device_get_output_name(device);
ck_assert_str_eq(output_name, "myOutput");
}
END_TEST
START_TEST(device_no_output)
{
struct litest_device *dev = litest_current_device();
struct libinput_device *device = dev->libinput_device;
const char *output_name;
output_name = libinput_device_get_output_name(device);
ck_assert(output_name == NULL);
}
END_TEST
void
litest_setup_tests_device(void)
{
......@@ -1622,4 +1644,8 @@ litest_setup_tests_device(void)
litest_add("device:size", device_has_size, LITEST_TABLET, LITEST_ANY);
litest_add("device:size", device_has_no_size, LITEST_ANY,
LITEST_TOUCHPAD|LITEST_TABLET|LITEST_TOUCH|LITEST_ABSOLUTE|LITEST_SINGLE_TOUCH);
litest_add_for_device("device:output", device_get_output, LITEST_CALIBRATED_TOUCHSCREEN);
litest_add("device:output", device_no_output, LITEST_RELATIVE, LITEST_ANY);
litest_add("device:output", device_no_output, LITEST_KEYS, LITEST_ANY);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment