static Eina_Bool
_e_input_remove_ecore_device(E_Input_Evdev *edev, Ecore_Device_Class clas)
{
+ Eina_Bool ret = EINA_FALSE;
const Eina_List *dev_list = NULL, *l;
+ const GList *e_dev_list = NULL;
Eina_List *ll, *ll_next;
Ecore_Device *dev = NULL, *data;
const char *identifier;
+ const gchar *device_identifier;
if (!edev->path) return EINA_FALSE;
}
_e_input_ecore_device_event(dev, edev->seat ? edev->seat->name : NULL, EINA_FALSE);
ecore_device_del(dev);
- return EINA_TRUE;
+ ret = EINA_TRUE;
}
}
- return EINA_FALSE;
+ e_dev_list = e_device_list_get();
+ if (!e_dev_list)
+ {
+ ERR("Failed to get e device list");
+ return EINA_FALSE;
+ }
+
+ for (GList *list = g_list_first((GList *)e_dev_list); list; list = list->next)
+ {
+ E_Device *device = (E_Device *)list->data;
+ if (!device) continue;
+ device_identifier = e_device_identifier_get(device);
+ if (!device_identifier) continue;
+
+ if ((e_device_class_get(device) == clas) && (!strcmp(device_identifier, edev->path)))
+ {
+ if (edev->e_dev)
+ {
+ g_object_unref(device);
+ edev->e_dev = NULL;
+ }
+ else if (edev->e_dev_list)
+ {
+ GList *del_list = g_list_find(edev->e_dev_list, device);
+ if (del_list)
+ {
+ g_object_unref(device);
+ edev->e_dev_list = g_list_delete_link(edev->e_dev_list, del_list);
+ }
+ }
+ ret = EINA_TRUE;
+ }
+ }
+
+ return ret;
}
Eina_Bool