From e49f676017606eab76974f8439b6ae4421667d7c Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 4 Oct 2017 14:13:41 +1000 Subject: [PATCH 1/6] libinput 1.8.3 --- .gitignore | 1 + ...pad-don-t-resume-a-disabled-touchpad.patch | 186 ------------------ libinput.spec | 7 +- sources | 2 +- 4 files changed, 6 insertions(+), 190 deletions(-) delete mode 100644 0001-touchpad-don-t-resume-a-disabled-touchpad.patch diff --git a/.gitignore b/.gitignore index 64164f2..f1bf3a7 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /libinput-1.8.0.tar.xz /libinput-1.8.1.tar.xz /libinput-1.8.2.tar.xz +/libinput-1.8.3.tar.xz diff --git a/0001-touchpad-don-t-resume-a-disabled-touchpad.patch b/0001-touchpad-don-t-resume-a-disabled-touchpad.patch deleted file mode 100644 index 8158120..0000000 --- a/0001-touchpad-don-t-resume-a-disabled-touchpad.patch +++ /dev/null @@ -1,186 +0,0 @@ -From 03f13ce6e854b3ff5d4b8971405a97afd66eef8e Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Tue, 5 Sep 2017 14:38:53 +1000 -Subject: [PATCH libinput] touchpad: don't resume a disabled touchpad - -Signed-off-by: Peter Hutterer ---- - src/evdev-mt-touchpad.c | 44 ++++++++++++++++++---------- - test/test-lid.c | 78 +++++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 107 insertions(+), 15 deletions(-) - -diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c -index 5b8fb1ec..c0a78255 100644 ---- a/src/evdev-mt-touchpad.c -+++ b/src/evdev-mt-touchpad.c -@@ -1426,6 +1426,31 @@ tp_resume(struct tp_dispatch *tp, struct evdev_device *device) - } - } - -+#define NO_EXCLUDED_DEVICE NULL -+static void -+tp_resume_conditional(struct tp_dispatch *tp, -+ struct evdev_device *device, -+ struct evdev_device *excluded_device) -+{ -+ if (tp->sendevents.current_mode == LIBINPUT_CONFIG_SEND_EVENTS_DISABLED) -+ return; -+ -+ if (tp->sendevents.current_mode == -+ LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE) { -+ struct libinput_device *dev; -+ -+ list_for_each(dev, &device->base.seat->devices_list, link) { -+ struct evdev_device *d = evdev_device(dev); -+ if (d != excluded_device && -+ (d->tags & EVDEV_TAG_EXTERNAL_MOUSE)) { -+ return; -+ } -+ } -+ } -+ -+ tp_resume(tp, device); -+} -+ - static void - tp_trackpoint_timeout(uint64_t now, void *data) - { -@@ -1667,7 +1692,7 @@ tp_lid_switch_event(uint64_t time, struct libinput_event *event, void *data) - swev = libinput_event_get_switch_event(event); - switch (libinput_event_switch_get_switch_state(swev)) { - case LIBINPUT_SWITCH_STATE_OFF: -- tp_resume(tp, tp->device); -+ tp_resume_conditional(tp, tp->device, NO_EXCLUDED_DEVICE); - evdev_log_debug(tp->device, "lid: resume touchpad\n"); - break; - case LIBINPUT_SWITCH_STATE_ON: -@@ -1722,7 +1747,6 @@ tp_interface_device_removed(struct evdev_device *device, - struct evdev_device *removed_device) - { - struct tp_dispatch *tp = (struct tp_dispatch*)device->dispatch; -- struct libinput_device *dev; - - if (removed_device == tp->buttons.trackpoint) { - /* Clear any pending releases for the trackpoint */ -@@ -1749,19 +1773,9 @@ tp_interface_device_removed(struct evdev_device *device, - tp->lid_switch.lid_switch = NULL; - } - -- if (tp->sendevents.current_mode != -- LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE) -- return; -- -- list_for_each(dev, &device->base.seat->devices_list, link) { -- struct evdev_device *d = evdev_device(dev); -- if (d != removed_device && -- (d->tags & EVDEV_TAG_EXTERNAL_MOUSE)) { -- return; -- } -- } -- -- tp_resume(tp, device); -+ /* removed_device is still in the device list at this point, so we -+ * need to exclude it from the tp_resume_conditional */ -+ tp_resume_conditional(tp, device, removed_device); - } - - static inline void -diff --git a/test/test-lid.c b/test/test-lid.c -index 4bf4c059..7e42f53d 100644 ---- a/test/test-lid.c -+++ b/test/test-lid.c -@@ -342,6 +342,81 @@ START_TEST(lid_disable_touchpad_already_open) - } - END_TEST - -+START_TEST(lid_dont_resume_disabled_touchpad) -+{ -+ struct litest_device *sw = litest_current_device(); -+ struct litest_device *touchpad; -+ struct libinput *li = sw->libinput; -+ -+ touchpad = lid_init_paired_touchpad(li); -+ litest_disable_tap(touchpad->libinput_device); -+ libinput_device_config_send_events_set_mode(touchpad->libinput_device, -+ LIBINPUT_CONFIG_SEND_EVENTS_DISABLED); -+ litest_drain_events(li); -+ -+ /* switch is on - no events */ -+ litest_lid_action(sw, LIBINPUT_SWITCH_STATE_ON); -+ litest_assert_only_typed_events(li, LIBINPUT_EVENT_SWITCH_TOGGLE); -+ -+ litest_touch_down(touchpad, 0, 50, 50); -+ litest_touch_move_to(touchpad, 0, 50, 50, 70, 50, 10, 1); -+ litest_touch_up(touchpad, 0); -+ litest_assert_empty_queue(li); -+ -+ /* switch is off - motion events */ -+ litest_lid_action(sw, LIBINPUT_SWITCH_STATE_OFF); -+ litest_assert_only_typed_events(li, LIBINPUT_EVENT_SWITCH_TOGGLE); -+ -+ litest_touch_down(touchpad, 0, 50, 50); -+ litest_touch_move_to(touchpad, 0, 50, 50, 70, 50, 10, 1); -+ litest_touch_up(touchpad, 0); -+ litest_assert_empty_queue(li); -+ -+ litest_delete_device(touchpad); -+} -+END_TEST -+ -+START_TEST(lid_dont_resume_disabled_touchpad_external_mouse) -+{ -+ struct litest_device *sw = litest_current_device(); -+ struct litest_device *touchpad, *mouse; -+ struct libinput *li = sw->libinput; -+ -+ touchpad = lid_init_paired_touchpad(li); -+ mouse = litest_add_device(li, LITEST_MOUSE); -+ litest_disable_tap(touchpad->libinput_device); -+ libinput_device_config_send_events_set_mode(touchpad->libinput_device, -+ LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE); -+ litest_drain_events(li); -+ -+ litest_touch_down(touchpad, 0, 50, 50); -+ litest_touch_move_to(touchpad, 0, 50, 50, 70, 50, 10, 1); -+ litest_touch_up(touchpad, 0); -+ litest_assert_empty_queue(li); -+ -+ /* switch is on - no events */ -+ litest_lid_action(sw, LIBINPUT_SWITCH_STATE_ON); -+ litest_assert_only_typed_events(li, LIBINPUT_EVENT_SWITCH_TOGGLE); -+ -+ litest_touch_down(touchpad, 0, 50, 50); -+ litest_touch_move_to(touchpad, 0, 50, 50, 70, 50, 10, 1); -+ litest_touch_up(touchpad, 0); -+ litest_assert_empty_queue(li); -+ -+ /* switch is off - motion events */ -+ litest_lid_action(sw, LIBINPUT_SWITCH_STATE_OFF); -+ litest_assert_only_typed_events(li, LIBINPUT_EVENT_SWITCH_TOGGLE); -+ -+ litest_touch_down(touchpad, 0, 50, 50); -+ litest_touch_move_to(touchpad, 0, 50, 50, 70, 50, 10, 1); -+ litest_touch_up(touchpad, 0); -+ litest_assert_empty_queue(li); -+ -+ litest_delete_device(touchpad); -+ litest_delete_device(mouse); -+} -+END_TEST -+ - START_TEST(lid_open_on_key) - { - struct litest_device *sw = litest_current_device(); -@@ -568,6 +643,9 @@ litest_setup_tests_lid(void) - litest_add("lid:disable_touchpad", lid_disable_touchpad_edge_scroll_interrupt, LITEST_SWITCH, LITEST_ANY); - litest_add("lid:disable_touchpad", lid_disable_touchpad_already_open, LITEST_SWITCH, LITEST_ANY); - -+ litest_add("switch:touchpad", lid_dont_resume_disabled_touchpad, LITEST_SWITCH, LITEST_ANY); -+ litest_add("switch:touchpad", lid_dont_resume_disabled_touchpad_external_mouse, LITEST_SWITCH, LITEST_ANY); -+ - litest_add("lid:keyboard", lid_open_on_key, LITEST_SWITCH, LITEST_ANY); - litest_add("lid:keyboard", lid_open_on_key_touchpad_enabled, LITEST_SWITCH, LITEST_ANY); - --- -2.13.5 - diff --git a/libinput.spec b/libinput.spec index 77bc2d4..affa141 100644 --- a/libinput.spec +++ b/libinput.spec @@ -4,7 +4,7 @@ %global gitversion 58abea394 Name: libinput -Version: 1.8.2 +Version: 1.8.3 Release: 1%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} Summary: Input device library @@ -18,8 +18,6 @@ Source2: commitid Source0: http://www.freedesktop.org/software/libinput/libinput-%{version}.tar.xz %endif -Patch02: 0001-touchpad-don-t-resume-a-disabled-touchpad.patch - BuildRequires: git-core BuildRequires: gcc BuildRequires: meson @@ -105,6 +103,9 @@ git am -p1 %{patches} < /dev/null %changelog +* Wed Oct 04 2017 Peter Hutterer 1.8.3-1 +- libinput 1.8.3 + * Thu Sep 07 2017 Peter Hutterer 1.8.2-1 - libinput 1.8.2 diff --git a/sources b/sources index 4848c70..befcd68 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libinput-1.8.2.tar.xz) = 555a7680cc8aaf62c5370a865f3aff0a933d42d94a3d8861c072666b02c9e1be45ea39de9a749a9575cdfb613b6150e412e18559d94d4919f21ca4680a3c76a7 +SHA512 (libinput-1.8.3.tar.xz) = 88006d217e3507858fa6b9ac1f25c267255fb51d1bcf1208d2afd423bf2a9292944bc5526ea91f27fad3ff04c2f9f43ab3aa25fd9fb7ace1231ecd33ddf18de6 From 1bea329e8ba38a16e4adfd059e4b3cb71e92b950 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 26 Oct 2017 11:27:28 +1000 Subject: [PATCH 2/6] libinput 1.9.0 --- .gitignore | 1 + libinput.spec | 12 +++++++++++- sources | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index f1bf3a7..ec4d583 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ /libinput-1.8.1.tar.xz /libinput-1.8.2.tar.xz /libinput-1.8.3.tar.xz +/libinput-1.9.0.tar.xz diff --git a/libinput.spec b/libinput.spec index affa141..6afb5b7 100644 --- a/libinput.spec +++ b/libinput.spec @@ -4,7 +4,7 @@ %global gitversion 58abea394 Name: libinput -Version: 1.8.3 +Version: 1.9.0 Release: 1%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} Summary: Input device library @@ -88,9 +88,16 @@ git am -p1 %{patches} < /dev/null %{_libexecdir}/libinput/libinput-list-devices %{_libexecdir}/libinput/libinput-measure %{_libexecdir}/libinput/libinput-measure-touchpad-tap +%{_libexecdir}/libinput/libinput-measure-touchpad-pressure +%{_libexecdir}/libinput/libinput-measure-touch-size +%{_libexecdir}/libinput/libinput-measure-trackpoint-range %{_mandir}/man1/libinput.1* %{_mandir}/man1/libinput-measure.1* %{_mandir}/man1/libinput-measure-touchpad-tap.1* +%{_mandir}/man1/libinput-measure-touch-size.1* +%{_mandir}/man1/libinput-measure-touchpad-pressure.1* +%{_mandir}/man1/libinput-measure-trackpoint-range.1* + %{_mandir}/man1/libinput-list-devices.1* %{_mandir}/man1/libinput-debug-events.1* %{_bindir}/libinput-list-devices @@ -103,6 +110,9 @@ git am -p1 %{patches} < /dev/null %changelog +* Thu Oct 26 2017 Peter Hutterer 1.9.0-1 +- libinput 1.9.0 + * Wed Oct 04 2017 Peter Hutterer 1.8.3-1 - libinput 1.8.3 diff --git a/sources b/sources index befcd68..c21a5b7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libinput-1.8.3.tar.xz) = 88006d217e3507858fa6b9ac1f25c267255fb51d1bcf1208d2afd423bf2a9292944bc5526ea91f27fad3ff04c2f9f43ab3aa25fd9fb7ace1231ecd33ddf18de6 +SHA512 (libinput-1.9.0.tar.xz) = 4111dd02ef7778c246da28ead284a77014f6eaa4b7f90f36ee124af809e31c70ac065216ef5648d1d2dc525355176e2aa22788bfbb19f5f6d25276fbba42e150 From b95fb99969a4ae38c7c9de02060a0f0d67f33711 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 31 Oct 2017 09:22:06 +1000 Subject: [PATCH 3/6] libinput 1.9.1 --- .gitignore | 1 + libinput.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index ec4d583..d5016e6 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ /libinput-1.8.2.tar.xz /libinput-1.8.3.tar.xz /libinput-1.9.0.tar.xz +/libinput-1.9.1.tar.xz diff --git a/libinput.spec b/libinput.spec index 6afb5b7..7a136bc 100644 --- a/libinput.spec +++ b/libinput.spec @@ -4,7 +4,7 @@ %global gitversion 58abea394 Name: libinput -Version: 1.9.0 +Version: 1.9.1 Release: 1%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} Summary: Input device library @@ -110,6 +110,9 @@ git am -p1 %{patches} < /dev/null %changelog +* Tue Oct 31 2017 Peter Hutterer 1.9.1-1 +- libinput 1.9.1 + * Thu Oct 26 2017 Peter Hutterer 1.9.0-1 - libinput 1.9.0 diff --git a/sources b/sources index c21a5b7..ad21d54 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libinput-1.9.0.tar.xz) = 4111dd02ef7778c246da28ead284a77014f6eaa4b7f90f36ee124af809e31c70ac065216ef5648d1d2dc525355176e2aa22788bfbb19f5f6d25276fbba42e150 +SHA512 (libinput-1.9.1.tar.xz) = e60c401cdec6b862c6c7186e636bba285e229b82998d9f86940659806bb64c295ec1060b5e8065345668e4b3ff95457bd01327351520d9f6cf8cbc98b9b95da0 From 6d66d8aea1a10f34b2917274d756a6565a9f11be Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 5 Feb 2018 19:55:55 +1000 Subject: [PATCH 4/6] libinput 1.9.4 --- .gitignore | 1 + libinput.spec | 6 ++++-- sources | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index d5016e6..b36f9a8 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ /libinput-1.8.3.tar.xz /libinput-1.9.0.tar.xz /libinput-1.9.1.tar.xz +/libinput-1.9.4.tar.xz diff --git a/libinput.spec b/libinput.spec index 7a136bc..d6ccaac 100644 --- a/libinput.spec +++ b/libinput.spec @@ -4,7 +4,7 @@ %global gitversion 58abea394 Name: libinput -Version: 1.9.1 +Version: 1.9.4 Release: 1%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} Summary: Input device library @@ -108,8 +108,10 @@ git am -p1 %{patches} < /dev/null %{_libdir}/libinput.so %{_libdir}/pkgconfig/libinput.pc - %changelog +* Mon Feb 05 2018 Peter Hutterer 1.9.4-1 +- libinput 1.9.4 + * Tue Oct 31 2017 Peter Hutterer 1.9.1-1 - libinput 1.9.1 diff --git a/sources b/sources index ad21d54..46cbbf5 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libinput-1.9.1.tar.xz) = e60c401cdec6b862c6c7186e636bba285e229b82998d9f86940659806bb64c295ec1060b5e8065345668e4b3ff95457bd01327351520d9f6cf8cbc98b9b95da0 +SHA512 (libinput-1.9.4.tar.xz) = 302f9497ea9ffb2163c643e9ca2f0a773ea141f6fe0a3aa3d8e86eb11a5d11e75d858b1e679ebfd3f913c645beac059cfd356b37c4ea17a8853068f79a740a4b From 0af31b541e40b0e74adc25709ee8931c315b8fd2 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 5 Feb 2018 19:38:58 +1000 Subject: [PATCH 5/6] Fix crasher on first event from tablets not supported by libwacom (#1535755) --- ...-rotation-on-a-tool-if-we-don-t-have.patch | 56 +++++++++++++++++++ libinput.spec | 8 ++- 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 0001-tablet-don-t-set-rotation-on-a-tool-if-we-don-t-have.patch diff --git a/0001-tablet-don-t-set-rotation-on-a-tool-if-we-don-t-have.patch b/0001-tablet-don-t-set-rotation-on-a-tool-if-we-don-t-have.patch new file mode 100644 index 0000000..d4ed141 --- /dev/null +++ b/0001-tablet-don-t-set-rotation-on-a-tool-if-we-don-t-have.patch @@ -0,0 +1,56 @@ +From d26b08b93f05eba58d46ad6811e71e9da0e74201 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Mon, 5 Feb 2018 09:11:42 +1000 +Subject: [PATCH libinput] tablet: don't set rotation on a tool if we don't + have ABS_Z + +Rotation on a tool can either ABS_Z or in the case of the mouse/lens tools a +combination of ABS_TILT_X/Y. The code assumes that if the rotation on a stylus +(not mouse/lense) changes, we need to fetch it from ABS_Z. This happens on the +very first event from the tablet, proximity in invalidates all axes so we can +send the current state to the caller. + +On libwacom-recognized tablets we never set the rotation bit on the stylus, so +that's all fine. On tablets without libwacom support, the stylus may have a +rotation bit copied because we have it set thanks to mouse+tilt on the tablet. +When that first event is handled, we try to access ABS_Z. On tablets without +ABS_Z like Aipteks, we go boom. + +Fix this by checking for ABS_Z during tablet init, if we don't have that axis +then never set the rotation bit on the tool. That's the only axis where we +need this, all other axes have a single cause only and thus the tablet bits +are accurate anyway. + +https://bugs.freedesktop.org/show_bug.cgi?id=104939 + +Signed-off-by: Peter Hutterer +--- + src/evdev-tablet.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/src/evdev-tablet.c b/src/evdev-tablet.c +index 2f6b64da..771e7775 100644 +--- a/src/evdev-tablet.c ++++ b/src/evdev-tablet.c +@@ -933,7 +933,17 @@ tool_set_bits(const struct tablet_dispatch *tablet, + copy_axis_cap(tablet, tool, LIBINPUT_TABLET_TOOL_AXIS_TILT_X); + copy_axis_cap(tablet, tool, LIBINPUT_TABLET_TOOL_AXIS_TILT_Y); + copy_axis_cap(tablet, tool, LIBINPUT_TABLET_TOOL_AXIS_SLIDER); +- copy_axis_cap(tablet, tool, LIBINPUT_TABLET_TOOL_AXIS_ROTATION_Z); ++ ++ /* Rotation is special, it can be either ABS_Z or ++ * BTN_TOOL_MOUSE+ABS_TILT_X/Y. Aiptek tablets have ++ * mouse+tilt (and thus rotation), but they do not have ++ * ABS_Z. So let's not copy the axis bit if we don't have ++ * ABS_Z, otherwise we try to get the value from it later on ++ * proximity in and go boom because the absinfo isn't there. ++ */ ++ if (libevdev_has_event_code(tablet->device->evdev, EV_ABS, ++ ABS_Z)) ++ copy_axis_cap(tablet, tool, LIBINPUT_TABLET_TOOL_AXIS_ROTATION_Z); + break; + case LIBINPUT_TABLET_TOOL_TYPE_MOUSE: + case LIBINPUT_TABLET_TOOL_TYPE_LENS: +-- +2.14.3 + diff --git a/libinput.spec b/libinput.spec index d6ccaac..145ec06 100644 --- a/libinput.spec +++ b/libinput.spec @@ -5,7 +5,7 @@ Name: libinput Version: 1.9.4 -Release: 1%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} +Release: 2%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} Summary: Input device library License: MIT @@ -18,6 +18,8 @@ Source2: commitid Source0: http://www.freedesktop.org/software/libinput/libinput-%{version}.tar.xz %endif +Patch01: 0001-tablet-don-t-set-rotation-on-a-tool-if-we-don-t-have.patch + BuildRequires: git-core BuildRequires: gcc BuildRequires: meson @@ -109,6 +111,10 @@ git am -p1 %{patches} < /dev/null %{_libdir}/pkgconfig/libinput.pc %changelog +* Mon Feb 05 2018 Peter Hutterer 1.9.901-3 +- Fix crasher on first event from tablets not supported by libwacom + (#1535755) + * Mon Feb 05 2018 Peter Hutterer 1.9.4-1 - libinput 1.9.4 From 1ee7b0d321a540334dd2c3c31f977443eaf3be64 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 13 Feb 2018 14:34:13 +1000 Subject: [PATCH 6/6] Fix crasher due to missing devnode after resume (#1536633) --- ...e-open_restricted-if-the-devnode-doe.patch | 47 +++++++++++++++++++ libinput.spec | 8 +++- 2 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 0001-evdev-fail-before-open_restricted-if-the-devnode-doe.patch diff --git a/0001-evdev-fail-before-open_restricted-if-the-devnode-doe.patch b/0001-evdev-fail-before-open_restricted-if-the-devnode-doe.patch new file mode 100644 index 0000000..4494695 --- /dev/null +++ b/0001-evdev-fail-before-open_restricted-if-the-devnode-doe.patch @@ -0,0 +1,47 @@ +From cb186abc17ad9e525609dc32385b0a7992e949a9 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Fri, 9 Feb 2018 19:24:15 +1000 +Subject: [PATCH libinput] evdev: fail before open_restricted if the devnode + doesn't exist + +https://bugzilla.redhat.com/show_bug.cgi?id=1536633 +https://bugzilla.redhat.com/show_bug.cgi?id=1539046 +https://bugzilla.redhat.com/show_bug.cgi?id=1539783 +https://bugzilla.redhat.com/show_bug.cgi?id=1540662 +https://bugs.freedesktop.org/show_bug.cgi?id=104278 + +Debugged-by: Jeff Smith +Signed-off-by: Peter Hutterer +--- + src/evdev.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/src/evdev.c b/src/evdev.c +index d1ca243d..63b93ec3 100644 +--- a/src/evdev.c ++++ b/src/evdev.c +@@ -1917,6 +1917,11 @@ evdev_device_create(struct libinput_seat *seat, + const char *devnode = udev_device_get_devnode(udev_device); + const char *sysname = udev_device_get_sysname(udev_device); + ++ if (!devnode) { ++ log_info(libinput, "%s: no device node associated\n", sysname); ++ return NULL; ++ } ++ + if (udev_device_should_be_ignored(udev_device)) { + log_debug(libinput, "%s: device is ignored\n", sysname); + return NULL; +@@ -2434,6 +2439,9 @@ evdev_device_resume(struct evdev_device *device) + return -ENODEV; + + devnode = udev_device_get_devnode(device->udev_device); ++ if (!devnode) ++ return -ENODEV; ++ + fd = open_restricted(libinput, devnode, + O_RDWR | O_NONBLOCK | O_CLOEXEC); + +-- +2.14.3 + diff --git a/libinput.spec b/libinput.spec index 145ec06..9c17b7b 100644 --- a/libinput.spec +++ b/libinput.spec @@ -5,7 +5,7 @@ Name: libinput Version: 1.9.4 -Release: 2%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} +Release: 3%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} Summary: Input device library License: MIT @@ -19,6 +19,7 @@ Source0: http://www.freedesktop.org/software/libinput/libinput-%{version} %endif Patch01: 0001-tablet-don-t-set-rotation-on-a-tool-if-we-don-t-have.patch +Patch02: 0001-evdev-fail-before-open_restricted-if-the-devnode-doe.patch BuildRequires: git-core BuildRequires: gcc @@ -111,7 +112,10 @@ git am -p1 %{patches} < /dev/null %{_libdir}/pkgconfig/libinput.pc %changelog -* Mon Feb 05 2018 Peter Hutterer 1.9.901-3 +* Tue Feb 13 2018 Peter Hutterer 1.9.4-3 +- Fix crasher due to missing devnode after resume (#1536633) + +* Mon Feb 05 2018 Peter Hutterer 1.9.4-2 - Fix crasher on first event from tablets not supported by libwacom (#1535755)