Index: branches/2019Q1/x11/libinput/Makefile =================================================================== --- branches/2019Q1/x11/libinput/Makefile (revision 489450) +++ branches/2019Q1/x11/libinput/Makefile (revision 489451) @@ -1,47 +1,48 @@ # $FreeBSD$ PORTNAME= libinput PORTVERSION= 1.11.3 +PORTREVISION= 1 CATEGORIES= x11 MASTER_SITES= http://freedesktop.org/software/${PORTNAME}/ MAINTAINER= x11@FreeBSD.org COMMENT= Generic input library LICENSE= MIT LICENSE_FILE= ${WRKSRC}/COPYING BUILD_DEPENDS= ${LOCALBASE}/include/linux/input.h:devel/evdev-proto RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}evdev>0:devel/py-evdev@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}pyudev>0:devel/py-pyudev@${PY_FLAVOR} LIB_DEPENDS= libevdev.so:devel/libevdev \ libepoll-shim.so:devel/libepoll-shim \ libudev.so:devel/libudev-devd \ libmtdev.so:devel/libmtdev USES= localbase meson pkgconfig python:3.4+,run shebangfix tar:xz MESON_ARGS+= -Ddocumentation=false -Dtests=false INSTALL_TARGET= install-strip python_OLD_CMD= "/usr/bin/env python3" SHEBANG_FILES= tools/libinput-measure-fuzz \ tools/libinput-measure-touch-size \ tools/libinput-measure-touchpad-pressure \ tools/libinput-measure-touchpad-tap \ tools/libinput-measure-trackpoint-range \ tools/libinput-replay OPTIONS_DEFINE= DEBUG_GUI LIBWACOM OPTIONS_DEFAULT=LIBWACOM OPTIONS_SUB= yes DEBUG_GUI_DESC= Build the GUI event viewer LIBWACOM_DESC= Libwacom support DEBUG_GUI_USE= GNOME=gtk30,glib20,cairo DEBUG_GUI_MESON_TRUE= debug-gui LIBWACOM_LIB_DEPENDS= libwacom.so:x11/libwacom LIBWACOM_MESON_TRUE= libwacom .include Index: branches/2019Q1/x11/libinput/files/patch-src_evdev.c =================================================================== --- branches/2019Q1/x11/libinput/files/patch-src_evdev.c (revision 489450) +++ branches/2019Q1/x11/libinput/files/patch-src_evdev.c (revision 489451) @@ -1,87 +1,37 @@ When a process without full /dev/input access enumerates devices via libudev-devd, the udev_device structs do not get udev properties that mark them as inputs, keyboards, etc, and get rejected as not being input devices. libinput reopens devices just to check path equality. The udev_devices from reopening do have the right properties, so we just use them instead of the original (enumerated) ones. --- src/evdev.c.orig 2018-06-09 12:13:43 UTC +++ src/evdev.c @@ -895,7 +895,7 @@ evdev_sync_device(struct evdev_device *device) evdev_device_dispatch_one(device, &ev); } while (rc == LIBEVDEV_READ_STATUS_SYNC); - return rc == -EAGAIN ? 0 : rc; + return (rc == -EAGAIN || rc == -EINVAL)? 0 : rc; } static void @@ -933,6 +933,17 @@ evdev_device_dispatch(void *data) if (rc != -EAGAIN && rc != -EINTR) { libinput_remove_source(libinput, device->source); + /* + * Dirty hack to allow cuse-based evdev backends to release + * character device file when device has been detached + * but still have it descriptor opened. + * Issuing evdev_device_suspend() here leads to SIGSEGV + */ + int dummy_fd = open("/dev/null", O_RDONLY | O_CLOEXEC); + if (dummy_fd >= 0) { + dup2(dummy_fd, device->fd); + close(dummy_fd); + } device->source = NULL; } } -@@ -1785,9 +1796,9 @@ evdev_notify_added_device(struct evdev_device *device) - } - - static bool --evdev_device_have_same_syspath(struct udev_device *udev_device, int fd) -+evdev_device_have_same_syspath(struct udev_device **udev_device, int fd, bool reopen) - { -- struct udev *udev = udev_device_get_udev(udev_device); -+ struct udev *udev = udev_device_get_udev(*udev_device); - struct udev_device *udev_device_new = NULL; - struct stat st; - bool rc = false; -@@ -1800,10 +1811,16 @@ evdev_device_have_same_syspath(struct udev_device *ude - goto out; - - rc = streq(udev_device_get_syspath(udev_device_new), -- udev_device_get_syspath(udev_device)); -+ udev_device_get_syspath(*udev_device)); - out: -- if (udev_device_new) -- udev_device_unref(udev_device_new); -+ if (udev_device_new) { -+ if (reopen) { -+ udev_device_unref(*udev_device); -+ *udev_device = udev_device_new; -+ } else { -+ udev_device_unref(udev_device_new); -+ } -+ } - return rc; - } - -@@ -2003,7 +2020,7 @@ evdev_device_create(struct libinput_seat *seat, - return NULL; - } - -- if (!evdev_device_have_same_syspath(udev_device, fd)) -+ if (!evdev_device_have_same_syspath(&udev_device, fd, true)) - goto err; - - device = zalloc(sizeof *device); -@@ -2559,7 +2576,7 @@ evdev_device_resume(struct evdev_device *device) - if (fd < 0) - return -errno; - -- if (!evdev_device_have_same_syspath(device->udev_device, fd)) { -+ if (!evdev_device_have_same_syspath(&device->udev_device, fd, false)) { - close_restricted(libinput, fd); - return -ENODEV; - } Index: branches/2019Q1 =================================================================== --- branches/2019Q1 (revision 489450) +++ branches/2019Q1 (revision 489451) Property changes on: branches/2019Q1 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /head:r489372