From fd0de9ae5c19dd333ec28b0c1712be76b2d68097 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Tue, 17 Feb 2015 16:18:13 -0500 Subject: [PATCH] ecore-drm: Fix issue with ecore_drm_evdev->path being incorrect Summary: When we try to ReleaseDevice of our evdev structure, the 'path' which was getting passed to our logind code was incorrect. This was due to libinput not providing a function to get the full device path. We fix this by making some eeze udev calls to find this device and get the full device path. @fix Signed-off-by: Chris Michael --- src/lib/ecore_drm/ecore_drm_evdev.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lib/ecore_drm/ecore_drm_evdev.c b/src/lib/ecore_drm/ecore_drm_evdev.c index fbc5959..2358a8d 100644 --- a/src/lib/ecore_drm/ecore_drm_evdev.c +++ b/src/lib/ecore_drm/ecore_drm_evdev.c @@ -545,6 +545,7 @@ Ecore_Drm_Evdev * _ecore_drm_evdev_device_create(Ecore_Drm_Seat *seat, struct libinput_device *device) { Ecore_Drm_Evdev *edev; + Eina_List *devices; EINA_SAFETY_ON_NULL_RETURN_VAL(seat, NULL); @@ -555,6 +556,26 @@ _ecore_drm_evdev_device_create(Ecore_Drm_Seat *seat, struct libinput_device *dev edev->device = device; edev->path = eina_stringshare_add(libinput_device_get_sysname(device)); + devices = eeze_udev_find_by_filter("input", NULL, edev->path); + if (eina_list_count(devices) >= 1) + { + Eina_List *l; + const char *dev, *name; + + EINA_LIST_FOREACH(devices, l, dev) + { + name = eeze_udev_syspath_get_devname(dev); + if (strstr(name, edev->path)) + { + eina_stringshare_replace(&edev->path, eeze_udev_syspath_get_devpath(dev)); + break; + } + } + + EINA_LIST_FREE(devices, dev) + eina_stringshare_del(dev); + } + if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_KEYBOARD)) { edev->seat_caps |= EVDEV_SEAT_KEYBOARD; -- 2.7.4