From 9b039b84f00b2c776476d0216e0abb71ace03686 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Aug 17 2016 01:00:48 +0000 Subject: Fix complaints about double tracking IDs on the MagicMouse (#1361325) --- diff --git a/0001-Don-t-bother-sanitizing-disabled-event-codes.patch b/0001-Don-t-bother-sanitizing-disabled-event-codes.patch new file mode 100644 index 0000000..9642b22 --- /dev/null +++ b/0001-Don-t-bother-sanitizing-disabled-event-codes.patch @@ -0,0 +1,37 @@ +From b313c87ab188c471b356b1c3a170bec5571aee68 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Wed, 17 Aug 2016 10:48:43 +1000 +Subject: [PATCH libevdev] Don't bother sanitizing disabled event codes + +Filter them immediately instead of passing them on and relying on the actual +event handling code to filter them. + +Reproducer: if EV_ABS is disabled on an Apple MagicMouse we still get events +passed into sanitize_event(). But the code handling EV_ABS events doesn't +update the state, so we end up complaining about double tracking IDs, even +though that is not actually correct. + +https://bugzilla.redhat.com/show_bug.cgi?id=1361325 + +Signed-off-by: Peter Hutterer +--- + libevdev/libevdev.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/libevdev/libevdev.c b/libevdev/libevdev.c +index 48b49b1..43a095c 100644 +--- a/libevdev/libevdev.c ++++ b/libevdev/libevdev.c +@@ -979,6 +979,9 @@ sanitize_event(const struct libevdev *dev, + struct input_event *ev, + enum SyncState sync_state) + { ++ if (!libevdev_has_event_code(dev, ev->type, ev->code)) ++ return EVENT_FILTER_DISCARD; ++ + if (unlikely(dev->num_slots > -1 && + libevdev_event_is_code(ev, EV_ABS, ABS_MT_SLOT) && + (ev->value < 0 || ev->value >= dev->num_slots))) { +-- +2.7.4 + diff --git a/libevdev.spec b/libevdev.spec index 8569e44..e3fa4be 100644 --- a/libevdev.spec +++ b/libevdev.spec @@ -1,6 +1,6 @@ Name: libevdev Version: 1.5.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Kernel Evdev Device Wrapper Library Group: System Environment/Libraries @@ -8,6 +8,8 @@ License: MIT URL: http://www.freedesktop.org/wiki/Software/libevdev Source0: http://www.freedesktop.org/software/%{name}/%{name}-%{version}.tar.xz +Patch01: 0001-Don-t-bother-sanitizing-disabled-event-codes.patch + BuildRequires: automake libtool BuildRequires: python @@ -31,6 +33,7 @@ Utilities to handle and/or debug evdev devices. %prep %setup -q -n %{name}-%{version} +%patch01 -p1 %build autoreconf --force -v --install || exit 1 @@ -65,6 +68,9 @@ rm -f %{buildroot}%{_libdir}/*.la %{_bindir}/libevdev-tweak-device %changelog +* Wed Aug 17 2016 Peter Hutterer 1.5.2-2 +- Fix complaints about double tracking IDs on the MagicMouse (#1361325) + * Wed Jun 15 2016 Peter Hutterer 1.5.2-1 - libevdev 1.5.2