E_Devicemgr_Input_Device *dev;
E_Devicemgr_Input_Device_User_Data *device_user_data;
+ e_devicemgr->wl_data->dev_resources = eina_list_remove(e_devicemgr->wl_data->dev_resources, resource);
+
if (!(device_user_data = wl_resource_get_user_data(resource))) return;
dev = device_user_data->dev;
E_FREE(device_user_data);
if (!dev) return;
-
dev->resources = eina_list_remove(dev->resources, resource);
}
device_user_data->seat_res = seat_res;
dev->resources = eina_list_append(dev->resources, res);
+ e_devicemgr->wl_data->dev_resources = eina_list_append(e_devicemgr->wl_data->dev_resources, res);
wl_resource_set_implementation(res, &_e_devicemgr_wl_device_interface, device_user_data,
_e_devicemgr_wl_device_cb_unbind);
tizen_input_device_manager_send_device_add(dev_mgr_res, serial, dev->identifier, res, seat_res);
static void
_e_devicemgr_wl_cb_unbind(struct wl_resource *resource)
{
+ struct wl_resource *device_res;
+ Eina_List *l, *l_next;
+ struct wl_client* wc;
+
if(!e_comp_wl) return;
+ DMINF("Unbind tizen_input_device_manager: %u (client: %p)", wl_resource_get_id(resource), wl_resource_get_client(resource));
+
+ EINA_LIST_FOREACH_SAFE(e_devicemgr->wl_data->dev_resources, l, l_next, device_res)
+ {
+ wc = wl_resource_get_client(resource);
+ if (wl_resource_get_client(device_res) != wc) continue;
+
+ DMINF("Destroy tizen_input_device:%u", wl_resource_get_id(device_res));
+ wl_resource_destroy(device_res);
+ }
+
e_devicemgr->wl_data->resources = eina_list_remove(e_devicemgr->wl_data->resources, resource);
}
device_user_data->seat_res = seat_res;
dev->resources = eina_list_append(dev->resources, device_res);
+ e_devicemgr->wl_data->dev_resources = eina_list_append(e_devicemgr->wl_data->dev_resources, device_res);
wl_resource_set_implementation(device_res, &_e_devicemgr_wl_device_interface, device_user_data,
_e_devicemgr_wl_device_cb_unbind);
return EINA_FALSE;
}
e_devicemgr->wl_data->resources = NULL;
+ e_devicemgr->wl_data->dev_resources = NULL;
/* initialization of cynara for checking privilege */
#ifdef HAVE_CYNARA