pepper: bugfix in pepper_seat_add_input_device
authorJaehoon Jeong <jh01.j@samsung.com>
Fri, 21 Aug 2015 04:01:55 +0000 (13:01 +0900)
committer김태균 <tkq.kim@samsung.com>
Mon, 24 Aug 2015 05:57:31 +0000 (14:57 +0900)
    - bugfix

Change-Id: I573bb0386b986defe048a3e74dcb91a732f3993a

src/lib/pepper/input.c

index 280e97c..cacbe8f 100644 (file)
@@ -365,9 +365,14 @@ PEPPER_API void
 pepper_seat_add_input_device(pepper_seat_t *seat, pepper_input_device_t *device)
 {
     pepper_input_device_entry_t *entry;
+    pepper_list_t               *l;
 
-    if (pepper_list_find_item(&seat->input_device_list, device))
-        return;
+    PEPPER_LIST_FOR_EACH(&seat->input_device_list, l)
+    {
+        pepper_input_device_entry_t *entry = l->item;
+        if (entry->device == device)
+            return ;
+    }
 
     entry = pepper_calloc(1, sizeof(pepper_input_device_entry_t));
     if (!entry)
@@ -376,6 +381,7 @@ pepper_seat_add_input_device(pepper_seat_t *seat, pepper_input_device_t *device)
     entry->seat = seat;
     entry->device = device;
 
+    entry->link.item = entry;
     entry->listener = pepper_object_add_event_listener(&device->base, PEPPER_EVENT_ALL, 0,
                                                        seat_handle_device_event, entry);
     pepper_list_insert(&seat->input_device_list, &entry->link);