e_input: close input device's fd in close restricted function only
authorjeon <jhyuni.kang@samsung.com>
Wed, 19 Dec 2018 10:48:00 +0000 (19:48 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Fri, 21 Dec 2018 10:27:37 +0000 (19:27 +0900)
Change-Id: I1a8c07bf09a5112e2743f7deed9abcf2105c37d6

src/bin/e_input_device.c
src/bin/e_input_evdev.c
src/bin/e_input_inputs.c
src/bin/e_input_private.h

index cd47c97..89aba27 100644 (file)
@@ -44,9 +44,6 @@ _e_input_device_cb_open_restricted(const char *path, int flags, void *data)
         return -1;
      }
 
-   if (input->dev->fd_hash)
-     eina_hash_add(input->dev->fd_hash, path, (void *)(intptr_t)fd);
-
    return fd;
 }
 
@@ -161,8 +158,8 @@ e_input_device_destroy(E_Input_Device *dev)
      {
         EINA_LIST_FREE(seat->devices, edev)
           {
-             if (edev->fd >= 0)
-               close(edev->fd);
+             libinput_device_config_send_events_set_mode(edev->device,
+                                                         LIBINPUT_CONFIG_SEND_EVENTS_DISABLED);
              _e_input_evdev_device_destroy(edev);
           }
 
index 91c8a50..76e9ae0 100644 (file)
@@ -1281,7 +1281,6 @@ _e_input_evdev_device_create(E_Input_Seat *seat, struct libinput_device *device)
    edev->seat = seat;
    edev->device = device;
    edev->path = eina_stringshare_printf("%s/%s", e_input_base_dir_get(), libinput_device_get_sysname(device));
-   edev->fd = -1;
 
    if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_KEYBOARD))
      {
index 9739e30..d04621f 100644 (file)
@@ -332,8 +332,6 @@ _device_added(E_Input_Backend *input, struct libinput_device *device)
         return;
      }
 
-   edev->fd = (int)(intptr_t)eina_hash_find(input->dev->fd_hash, edev->path);
-
    /* append this device to the seat */
    seat->devices = eina_list_append(seat->devices, edev);
 
@@ -360,16 +358,6 @@ _device_removed(E_Input_Backend *input, struct libinput_device *device)
    /* remove this evdev from the seat's list of devices */
    edev->seat->devices = eina_list_remove(edev->seat->devices, edev);
 
-   if (input->dev->fd_hash)
-     eina_hash_del_by_key(input->dev->fd_hash, edev->path);
-
-   /* tell launcher to release device */
-   if (edev->fd >= 0)
-     {
-        close(edev->fd);
-        edev->fd = -1;
-     }
-
    /* destroy this evdev */
    _e_input_evdev_device_destroy(edev);
 }
index 5c50920..abc8991 100644 (file)
@@ -63,7 +63,6 @@ struct _E_Input_Evdev
    struct libinput_device *device;
 
    const char *path;
-   int fd;
    Ecore_Device *ecore_dev;
    Eina_List *ecore_dev_list;