From 575f40be658af320c2bf7f7a8f8d7fd82273c6ad Mon Sep 17 00:00:00 2001 From: jeon Date: Thu, 7 May 2020 15:23:37 +0900 Subject: [PATCH] e_comp_wl_rsm: add logs in input event transfer request Change-Id: I9f8ee9e3573519e3876209592eff7084d07108d3 --- src/bin/e_comp_wl_rsm.c | 70 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/src/bin/e_comp_wl_rsm.c b/src/bin/e_comp_wl_rsm.c index 7e88421d37..d2ec7acd70 100644 --- a/src/bin/e_comp_wl_rsm.c +++ b/src/bin/e_comp_wl_rsm.c @@ -1624,6 +1624,9 @@ _remote_surface_cb_mouse_event_transfer(struct wl_client *client, struct wl_reso Ecore_Device_Class eclas = ECORE_DEVICE_CLASS_NONE; double eradx, erady, epressure, eangle; + E_Comp_Config *comp_conf = NULL; + pid_t pid = 0; + remote_surface = wl_resource_get_user_data(resource); EINA_SAFETY_ON_NULL_RETURN(remote_surface); EINA_SAFETY_ON_FALSE_RETURN(remote_surface->valid); @@ -1652,6 +1655,19 @@ _remote_surface_cb_mouse_event_transfer(struct wl_client *client, struct wl_reso epressure = wl_fixed_to_double(pressure); eangle = wl_fixed_to_double(angle); + comp_conf = e_comp_config_get(); + if (comp_conf && comp_conf->input_log_enable) + { + if (event_type != TIZEN_REMOTE_SURFACE_EVENT_TYPE_MOUSE_MOVE) + { + wl_client_get_credentials(client, &pid, NULL, NULL); + ELOGF("TRS", "TRANSFER Mouse event [pid: %d -> pid: %d (ec: %p)] type: %d, time: %d", + NULL, pid, ec?ec->netwm.pid:-1, ec, event_type, time); + ELOGF("TRS", "\tDetail: device: %d, button: %d, x:%d, y:%d, clas: %d, identifier: %20s", + NULL, device, button, x, y, clas, identifier); + } + } + if (eclas == ECORE_DEVICE_CLASS_MOUSE) { switch (event_type) @@ -1757,6 +1773,9 @@ _remote_surface_cb_mouse_wheel_transfer(struct wl_client *client, struct wl_reso Ecore_Device *edev = NULL; Ecore_Device_Class eclas = ECORE_DEVICE_CLASS_NONE; + E_Comp_Config *comp_conf = NULL; + pid_t pid = 0; + remote_surface = wl_resource_get_user_data(resource); EINA_SAFETY_ON_NULL_RETURN(remote_surface); EINA_SAFETY_ON_FALSE_RETURN(remote_surface->valid); @@ -1777,6 +1796,16 @@ _remote_surface_cb_mouse_wheel_transfer(struct wl_client *client, struct wl_reso } edev = _device_get_by_identifier(identifier, eclas); + comp_conf = e_comp_config_get(); + if (comp_conf && comp_conf->input_log_enable) + { + wl_client_get_credentials(client, &pid, NULL, NULL); + ELOGF("TRS", "TRANSFER Mouse wheel [pid: %d -> pid: %d (ec: %p)], time: %d", + NULL, pid, ec?ec->netwm.pid:-1, ec, time); + ELOGF("TRS", "\tDetail: direction: %d, z: %d, clas: %d, identifier: %20s)", + NULL, direction, z, clas, identifier); + } + e_client_mouse_wheel_send(ec, direction, z, edev, time); } @@ -1791,6 +1820,9 @@ _remote_surface_cb_touch_event_transfer(struct wl_client *client, struct wl_reso Ecore_Device_Class eclas = ECORE_DEVICE_CLASS_NONE; double eradx, erady, epressure, eangle; + E_Comp_Config *comp_conf = NULL; + pid_t pid = 0; + remote_surface = wl_resource_get_user_data(resource); EINA_SAFETY_ON_NULL_RETURN(remote_surface); EINA_SAFETY_ON_FALSE_RETURN(remote_surface->valid); @@ -1829,6 +1861,19 @@ _remote_surface_cb_touch_event_transfer(struct wl_client *client, struct wl_reso epressure = wl_fixed_to_double(pressure); eangle = wl_fixed_to_double(angle); + comp_conf = e_comp_config_get(); + if (comp_conf && comp_conf->input_log_enable) + { + if (event_type != TIZEN_REMOTE_SURFACE_EVENT_TYPE_TOUCH_MOVE) + { + wl_client_get_credentials(client, &pid, NULL, NULL); + ELOGF("TRS", "TRANSFER Touch event [pid: %d -> pid: %d (ec: %p)] type: %d, time: %d", + NULL, pid, ec?ec->netwm.pid:-1, ec, event_type, time); + ELOGF("TRS", "\tDetail: device: %d, button: %d, x: %d, y: %d, clas: %d, identifier: %20s", + NULL, device, button, x, y, clas, identifier); + } + } + if (eclas == ECORE_DEVICE_CLASS_TOUCH) { switch (event_type) @@ -1879,6 +1924,9 @@ _remote_surface_cb_touch_cancel_transfer(struct wl_client *client, struct wl_res E_Comp_Wl_Remote_Surface *remote_surface; E_Client *ec; + E_Comp_Config *comp_conf = NULL; + pid_t pid = 0; + remote_surface = wl_resource_get_user_data(resource); EINA_SAFETY_ON_NULL_RETURN(remote_surface); EINA_SAFETY_ON_FALSE_RETURN(remote_surface->valid); @@ -1889,6 +1937,15 @@ _remote_surface_cb_touch_cancel_transfer(struct wl_client *client, struct wl_res ec = provider->common.ec; if (e_object_is_del(E_OBJECT(ec))) return; + + comp_conf = e_comp_config_get(); + if (comp_conf && comp_conf->input_log_enable) + { + wl_client_get_credentials(client, &pid, NULL, NULL); + ELOGF("TRS", "TRANSFER Touch cancel [pid: %d -> pid: %d (ec: %p)]", + NULL, pid, ec?ec->netwm.pid:-1, ec); + } + e_client_touch_cancel_send(ec); } @@ -1902,6 +1959,9 @@ _remote_surface_cb_key_event_transfer(struct wl_client *client, struct wl_resour Ecore_Device *edev = NULL; Ecore_Device_Class eclas = ECORE_DEVICE_CLASS_NONE; + E_Comp_Config *comp_conf = NULL; + pid_t pid = 0; + remote_surface = wl_resource_get_user_data(resource); EINA_SAFETY_ON_NULL_RETURN(remote_surface); EINA_SAFETY_ON_FALSE_RETURN(remote_surface->valid); @@ -1922,6 +1982,16 @@ _remote_surface_cb_key_event_transfer(struct wl_client *client, struct wl_resour return; } + comp_conf = e_comp_config_get(); + if (comp_conf && comp_conf->input_log_enable) + { + wl_client_get_credentials(client, &pid, NULL, NULL); + ELOGF("TRS", "TRANSFER Key event [pid: %d -> pid: %d (ec: %p)] type: %d, time: %d", + NULL, pid, ec?ec->netwm.pid:-1, ec, event_type, time); + ELOGF("TRS", "\tDetail: keycode: %d, clas: %d, identifier: %20s", + NULL, keycode, clas, identifier); + } + /* find ecore device*/ edev = _device_get_by_identifier(identifier, eclas); -- 2.34.1