if (!dev) return;
if (!dev->name) return;
+ if (!dev->identifier) return;
if (!dev->input || !dev->input->display) return;
if (flag)
EINA_LIST_FOREACH(input->devmgr.devices, l, dev)
{
+ if (!dev->name || !dev->identifier) continue;
_ecore_wl2_input_device_info_send(win->id, dev->name, dev->identifier, dev->clas, dev->subclas, EINA_TRUE);
}
}
Ecore_Wl2_Tizen_Input_Device *dev;
if (!ewd) return;
- if ((!identifier) || (!device) || (!seat)) return;
+ if ((!identifier) || (!device) || (!seat))
+ {
+ ERR("Invalid arguments. return");
+ return;
+ }
input = wl_seat_get_user_data(seat);
Ecore_Wl2_Tizen_Input_Device *dev;
if (!ewd) return;
- if ((!identifier) || (!device) || (!seat)) return;
+ if ((!identifier) || (!device) || (!seat))
+ {
+ ERR("Invalid arguments. return");
+ return;
+ }
input = wl_seat_get_user_data(seat);
ev = event;
if (ee->prop.window != ev->window) return ECORE_CALLBACK_PASS_ON;
+ if (!ev->identifier) return ECORE_CALLBACK_PASS_ON;
if (_ecore_evas_tbm_evas_device_find(ee->evas, ev->identifier, ev->clas)) return ECORE_CALLBACK_PASS_ON;
seat = _ecore_evas_tbm_default_seat_get(ee->evas);
Eina_List *list, *l, *l_next;
Evas_Device *device;
const char *evas_device_description;
+ Evas_Device_Class evas_cls = EVAS_DEVICE_CLASS_NONE;
ev = event;
if (ee->prop.window != ev->window) return ECORE_CALLBACK_PASS_ON;
+ if (!ev->identifier) return ECORE_CALLBACK_PASS_ON;
+
+ evas_cls = _ecore_evas_tbm_ecore_device_class_to_evas(ev->clas);
list = (Eina_List *)evas_device_list(ee->evas, NULL);
EINA_LIST_FOREACH_SAFE(list, l, l_next, device)
{
evas_device_description = evas_device_description_get(device);
if (!evas_device_description) continue;
- if (!strncmp(evas_device_description, ev->identifier, strlen(ev->identifier)))
+
+ if (_ecore_evas_tbm_strcmp(evas_device_description, ev->identifier) &&
+ evas_device_class_get(device) == evas_cls)
{
evas_device_del(device);
}
// TIZEN_ONLY(20171109): support a tizen_input_device_manager interface
+static Evas_Device_Class
+_ecore_evas_wl_common_ecore_device_class_to_evas(Ecore_Device_Class cls)
+{
+ switch (cls)
+ {
+ case ECORE_DEVICE_CLASS_NONE:
+ return EVAS_DEVICE_CLASS_NONE;
+ case ECORE_DEVICE_CLASS_SEAT:
+ return EVAS_DEVICE_CLASS_SEAT;
+ case ECORE_DEVICE_CLASS_KEYBOARD:
+ return EVAS_DEVICE_CLASS_KEYBOARD;
+ case ECORE_DEVICE_CLASS_MOUSE:
+ return EVAS_DEVICE_CLASS_MOUSE;
+ case ECORE_DEVICE_CLASS_TOUCH:
+ return EVAS_DEVICE_CLASS_TOUCH;
+ case ECORE_DEVICE_CLASS_PEN:
+ return EVAS_DEVICE_CLASS_PEN;
+ case ECORE_DEVICE_CLASS_WAND:
+ return EVAS_DEVICE_CLASS_WAND;
+ case ECORE_DEVICE_CLASS_GAMEPAD:
+ return EVAS_DEVICE_CLASS_GAMEPAD;
+ default:
+ return EVAS_DEVICE_CLASS_NONE;
+ }
+}
+
static Eina_Bool
-_ecore_evas_wl_common_evas_device_find(Evas *evas, const char *name, const Evas_Device_Class clas, const char *identifier)
+_ecore_evas_wl_common_evas_device_find(Evas *evas, const char *name, const Ecore_Device_Class ecore_cls, const char *identifier)
{
Eina_List *list, *l;
Evas_Device *device;
const char *evas_device_name;
const char *evas_device_description;
+ Evas_Device_Class evas_cls = EVAS_DEVICE_CLASS_NONE;
EINA_SAFETY_ON_NULL_RETURN_VAL(evas, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(name, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(identifier, EINA_FALSE);
+ evas_cls = _ecore_evas_wl_common_ecore_device_class_to_evas(ecore_cls);
+
list = (Eina_List *)evas_device_list(evas, NULL);
EINA_LIST_FOREACH(list, l, device)
{
evas_device_description = evas_device_description_get(device);
if (!evas_device_name || !evas_device_description) continue;
- if ((evas_device_class_get(device) == clas) &&
+ if ((evas_device_class_get(device) == evas_cls) &&
_ecore_evas_wl_common_strcmp(evas_device_name, name) &&
_ecore_evas_wl_common_strcmp(evas_device_description, identifier))
{
Eina_List *l;
ev = event;
+ if (!ev->name) return ECORE_CALLBACK_PASS_ON;
+ if (!ev->identifier) return ECORE_CALLBACK_PASS_ON;
if (ev->window) win = ecore_wl2_window_find(ev->window);
if (win) display = ecore_wl2_window_display_get(win);
Ecore_Wl2_Display *display = NULL;
Ecore_Evas *ee;
Eina_List *list, *l, *ll, *ll_next;
+ const char *evas_device_name;
+ const char *evas_device_description;
+ Evas_Device_Class evas_cls = EVAS_DEVICE_CLASS_NONE;
ev = event;
+ if (!ev->name) return ECORE_CALLBACK_PASS_ON;
+ if (!ev->identifier) return ECORE_CALLBACK_PASS_ON;
+ evas_cls = _ecore_evas_wl_common_ecore_device_class_to_evas(ev->clas);
+
if (ev->window) win = ecore_wl2_window_find(ev->window);
if (win) display = ecore_wl2_window_display_get(win);
- if (!ev->identifier) return ECORE_CALLBACK_PASS_ON;
-
EINA_LIST_FOREACH(ee_list, l, ee)
{
Ecore_Evas_Engine_Wl_Data *wdata;
Evas_Device *device;
- char *evas_device_description;
wdata = ee->engine.data;
if (display != wdata->display) continue;
list = (Eina_List *)evas_device_list(ee->evas, NULL);
EINA_LIST_FOREACH_SAFE(list, ll, ll_next, device)
{
- evas_device_description = (char *)evas_device_description_get(device);
- if (!evas_device_description) continue;
+ evas_device_name = evas_device_name_get(device);
+ evas_device_description = evas_device_description_get(device);
+ if (!evas_device_name || !evas_device_description) continue;
- if (_ecore_evas_wl_common_strcmp(evas_device_description, ev->identifier))
+ if ((evas_device_class_get(device) == evas_cls) &&
+ _ecore_evas_wl_common_strcmp(evas_device_name, ev->name) &&
+ _ecore_evas_wl_common_strcmp(evas_device_description, ev->identifier))
{
evas_device_del(device);
}