From: Jihoon Kim Date: Mon, 9 Jan 2017 09:30:12 +0000 (+0900) Subject: Replace code to call printf for logging X-Git-Tag: submit/tizen_3.0/20170109.104857~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4a7cc43e472b87ac402e96b8bffc53f4fbdcf9a7;p=platform%2Fcore%2Fuifw%2Fe-mod-tizen-wl-textinput.git Replace code to call printf for logging Using printf causes write command unable to get lock to write to console in turn causing deadlock in processes. Change-Id: I921fb834fb5faddcf7d94d4be42860436e7dde90 Signed-off-by: Jihoon Kim --- diff --git a/src/e_mod_input_panel.c b/src/e_mod_input_panel.c index 83b3552..4ce46b9 100644 --- a/src/e_mod_input_panel.c +++ b/src/e_mod_input_panel.c @@ -135,7 +135,7 @@ _e_input_panel_surface_cb_ready_set(struct wl_client *client EINA_UNUSED, struct if (g_input_panel->wait_update) { - WTI_LOG("IPS::SHOW::READY\n"); + LOGD("IPS::SHOW::READY\n"); e_input_panel_visibility_change(EINA_TRUE); e_input_panel_wait_update_set(EINA_FALSE); } @@ -233,7 +233,7 @@ _ips_show(E_Client *ec) if (ec->visible) return; - WTI_LOG("IPS::SHOW\n"); + LOGD("IPS::SHOW\n"); _e_input_panel_position_set(ec, ec->client.w, ec->client.h); @@ -259,7 +259,7 @@ _ips_cb_buffer_change(void *data, int type, void *event) if (!ips->wait_update) goto clean; - WTI_LOG("IPS::BUFFER::CHANGED::DEFER_SHOW\n"); + LOGD("IPS::BUFFER::CHANGED::DEFER_SHOW\n"); if (_e_input_panel_is_effect_running(ips->ec)) ips->need_show = EINA_TRUE; @@ -302,7 +302,7 @@ _e_input_panel_surface_visible_update(E_Input_Panel_Surface *ips) if (ec->visible) return; - WTI_LOG("IPS::DEFER_SHOW::ADD\n"); + LOGD("IPS::DEFER_SHOW::ADD\n"); ips->wait_update = EINA_TRUE; if (!ips->eh.buf_change) { @@ -314,7 +314,7 @@ _e_input_panel_surface_visible_update(E_Input_Panel_Surface *ips) } else { - WTI_LOG("IPS::DEFER_SHOW::HIDE\n"); + LOGD("IPS::DEFER_SHOW::HIDE\n"); ips->wait_update = EINA_FALSE; ec->visible = EINA_FALSE; /* We have to reset the flag of pending_show to prevent showing after @@ -642,7 +642,7 @@ e_input_panel_visibility_change(Eina_Bool visible) if (!g_input_panel) return; - WTI_LOG("e_input_panel_visibility_change : %d\n", visible); + LOGD("e_input_panel_visibility_change : %d\n", visible); EINA_LIST_FOREACH(g_input_panel->surfaces, l, ips) { @@ -795,7 +795,7 @@ _ips_client_frame_flush(E_Input_Panel_Surface *ips) if (e_object_is_del(E_OBJECT(ips->ec))) return; - WTI_LOG("IPS::FRAME::FLUSH ec %p\n", ips->ec); + LOGD("IPS::FRAME::FLUSH ec %p\n", ips->ec); e_pixmap_image_clear(ips->ec->pixmap, EINA_TRUE); } @@ -847,7 +847,7 @@ e_input_panel_wait_update_set(Eina_Bool wait_update) if (!g_input_panel->buf_change_handler) { - WTI_LOG("IPS::WAIT::UPDATE::SET (add buf change handler)\n"); + LOGD("IPS::WAIT::UPDATE::SET (add buf change handler)\n"); g_input_panel->buf_change_handler = ecore_event_handler_add(E_EVENT_CLIENT_BUFFER_CHANGE, _ip_cb_e_buf_change, NULL); } @@ -860,7 +860,7 @@ e_input_panel_wait_update_set(Eina_Bool wait_update) EINTERN void e_input_panel_transient_for_set(E_Client *parent) { - WTI_LOG("TRANSIENT_FOR::transient_for_set : %p\n", parent); + LOGD("TRANSIENT_FOR::transient_for_set : %p\n", parent); E_Input_Panel_Surface *ips; Eina_List *l; E_Client *ec_parent = parent; @@ -885,14 +885,14 @@ e_input_panel_transient_for_set(E_Client *parent) /* If the child already has a parent, remove it */ if (child->parent) { - WTI_LOG("TRANSIENT_FOR::The child already has a parent : %p\n", child->parent); + LOGD("TRANSIENT_FOR::The child already has a parent : %p\n", child->parent); if (ec_parent != child->parent) { child->parent->transients = eina_list_remove(child->parent->transients, child); if (child->parent->modal == child) child->parent->modal = NULL; child->parent = NULL; - WTI_LOG("TRANSIENT_FOR::reset parent %p for : %p\n", child->parent, child); + LOGD("TRANSIENT_FOR::reset parent %p for : %p\n", child->parent, child); } } @@ -901,7 +901,7 @@ e_input_panel_transient_for_set(E_Client *parent) { if ((ec_parent) && (eina_list_data_find(parent->transients, child) != child)) { - WTI_LOG("TRANSIENT_FOR::Adding %p into parent %p's transients list\n", child, ec_parent); + LOGD("TRANSIENT_FOR::Adding %p into parent %p's transients list\n", child, ec_parent); ec_parent->transients = eina_list_append(ec_parent->transients, child); } child->parent = ec_parent; diff --git a/src/e_mod_main.c b/src/e_mod_main.c index b739048..e571ad2 100644 --- a/src/e_mod_main.c +++ b/src/e_mod_main.c @@ -1049,7 +1049,7 @@ _e_text_input_cb_activate(struct wl_client *client, struct wl_resource *resource client_surface_ec = ec; e_input_panel_transient_for_set(client_surface_ec); - WTI_LOG("TRANSIENT_FOR::Application window's E_Client* value : %p\n", client_surface_ec); + LOGD("TRANSIENT_FOR::Application window's E_Client* value : %p\n", client_surface_ec); text_input = wl_resource_get_user_data(resource); g_text_input = text_input; @@ -1217,11 +1217,9 @@ _e_text_input_cb_input_panel_show(struct wl_client *client, struct wl_resource * if (g_input_method && g_input_method->resource) input_method = wl_resource_get_user_data(g_input_method->resource); - /* - If input_method->context doesn't exist, create context struct to send input_panel_show event to Input Method(IME) correctly. - Because input_panel_show event can be called before focus_in(activate) by application. - And Input Method(IME) should know the state of their own input_panel to manage their resource when the input_panel is shown. - */ + /* If input_method->context doesn't exist, create context struct to send input_panel_show event to Input Method(IME) correctly. + * Because input_panel_show event can be called before focus_in(activate) by application. + * And Input Method(IME) should know the state of their own input_panel to manage their resource when the input_panel is shown. */ if (input_method && (!input_method->context || !input_method->context->resource)) _e_text_input_method_create_context(client, input_method, text_input); @@ -1229,7 +1227,7 @@ _e_text_input_cb_input_panel_show(struct wl_client *client, struct wl_resource * { /* DO NOT show input panel surface until we get message "show complete" from input method, * in order to give a change to update UI */ - WTI_LOG("IM::SHOW::WAIT_FOR_READY\n"); + LOGD("IM::SHOW::WAIT_FOR_READY\n"); wl_input_method_send_show_input_panel(input_method->resource, input_method->context->resource); @@ -1989,7 +1987,7 @@ _pol_cb_hook_client_del(void *d EINA_UNUSED, E_Client *ec) if (ec == client_surface_ec) { - WTI_LOG("transient_for_ec deleted, hiding input panel\n"); + LOGD("transient_for_ec deleted, hiding input panel\n"); e_input_panel_visibility_change(EINA_FALSE); e_input_panel_transient_for_set(NULL); g_input_panel_state = E_INPUT_PANEL_STATE_DID_HIDE; @@ -1999,7 +1997,7 @@ _pol_cb_hook_client_del(void *d EINA_UNUSED, E_Client *ec) g_timer_will_hide = NULL; } client_surface_ec = NULL; - WTI_LOG("TRANSIENT_FOR::Reset transient_for_ec to NULL\n"); + LOGD("TRANSIENT_FOR::Reset transient_for_ec to NULL\n"); } } diff --git a/src/wti_log.h b/src/wti_log.h index 4c11f89..566d4f9 100644 --- a/src/wti_log.h +++ b/src/wti_log.h @@ -19,10 +19,6 @@ #undef CRI #endif -#ifndef WTI_LOG -#define WTI_LOG(...) printf(__VA_ARGS__) -#endif - extern EINTERN int _wti_log_domain; #define DBG(...) EINA_LOG_DOM_DBG(_wti_log_domain, __VA_ARGS__) #define INF(...) EINA_LOG_DOM_INFO(_wti_log_domain, __VA_ARGS__)