devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=fd0de9ae5c19dd333ec28b0c1712be76b2d68097

commit fd0de9ae5c19dd333ec28b0c1712be76b2d68097
Author: Chris Michael <cp.mich...@samsung.com>
Date:   Tue Feb 17 16:18:13 2015 -0500

    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 <cp.mich...@samsung.com>
---
 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;

-- 


Reply via email to