ecore-drm: Fix issue of ecore_drm not calling ReleaseDevice when an
authorChris Michael <cp.michael@samsung.com>
Tue, 17 Feb 2015 21:15:52 +0000 (16:15 -0500)
committerChris Michael <cp.michael@samsung.com>
Tue, 17 Feb 2015 21:19:55 +0000 (16:19 -0500)
input is destroyed

Summary: This fixes an issue where if you VT switch away from a
running Enlightenment and VT switch back, then input would no longer
be working. This was because we never called ReleaseDevice (dbus call)
when we destroyed a device, so any calls to recreate the device would
fail in libinput due to control already being taken.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/lib/ecore_drm/ecore_drm_inputs.c

index 45dce8f..d83f229 100644 (file)
@@ -122,6 +122,9 @@ _device_removed(Ecore_Drm_Input *input EINA_UNUSED, struct libinput_device *devi
    /* remove this evdev from the seat's list of devices */
    edev->seat->devices = eina_list_remove(edev->seat->devices, edev);
 
+   /* tell launcher to release device */
+   _ecore_drm_launcher_device_close(edev->path, edev->fd);
+
    /* destroy this evdev */
    _ecore_drm_evdev_device_destroy(edev);
 }
@@ -280,7 +283,10 @@ ecore_drm_inputs_destroy(Ecore_Drm_Device *dev)
    EINA_LIST_FREE(dev->seats, seat)
      {
         EINA_LIST_FREE(seat->devices, edev)
-          _ecore_drm_evdev_device_destroy(edev);
+          {
+             _ecore_drm_launcher_device_close(edev->path, edev->fd);
+             _ecore_drm_evdev_device_destroy(edev);
+          }
 
         if (seat->name) eina_stringshare_del(seat->name);
         free(seat);