From c7b80aa77919b9aba887e6ae6b4f381768d0e3a9 Mon Sep 17 00:00:00 2001 From: Hosang Kim Date: Tue, 8 Sep 2020 19:32:19 +0900 Subject: [PATCH] ecore_evas_wayland_common: check device class when device is added. Change-Id: I1d73f9cbf34bb46a01f2428dda4cf9443187c508 --- .../ecore_evas/engines/wayland/ecore_evas_wayland_common.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c index d00555f..8466320 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c @@ -1610,22 +1610,27 @@ _ecore_evas_wl_common_strcmp(const char *dst, const char *src) // TIZEN_ONLY(20171109): support a tizen_input_device_manager interface static Eina_Bool -_ecore_evas_wl_common_evas_device_find(Evas *evas, const char *identifier) +_ecore_evas_wl_common_evas_device_find(Evas *evas, const char *name, const Evas_Device_Class clas, const char *identifier) { Eina_List *list, *l; Evas_Device *device; + const char *evas_device_name; const char *evas_device_description; 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); list = (Eina_List *)evas_device_list(evas, NULL); EINA_LIST_FOREACH(list, l, device) { + evas_device_name = evas_device_name_get(device); evas_device_description = evas_device_description_get(device); - if (!evas_device_description) continue; + if (!evas_device_name || !evas_device_description) continue; - if (_ecore_evas_wl_common_strcmp(evas_device_description, identifier)) + if ((evas_device_class_get(device) == clas) && + _ecore_evas_wl_common_strcmp(evas_device_name, name) && + _ecore_evas_wl_common_strcmp(evas_device_description, identifier)) { return EINA_TRUE; } @@ -1678,7 +1683,7 @@ _ecore_evas_wl_common_cb_tizen_device_add(void *data EINA_UNUSED, int type EINA_ wdata = ee->engine.data; if (display != wdata->display) continue; - if (_ecore_evas_wl_common_evas_device_find(ee->evas, ev->identifier)) continue; + if (_ecore_evas_wl_common_evas_device_find(ee->evas, ev->name, ev->clas, ev->identifier)) continue; seat = _ecore_evas_wl_common_default_seat_get(ee->evas); evas_device_add_full(ee->evas, ev->name, -- 2.7.4