From: Jihoon Kim Date: Fri, 22 Nov 2024 05:19:41 +0000 (+0900) Subject: remove ecore_thread_main_loop_begin() and end() for improving performance X-Git-Tag: accepted/tizen/8.0/unified/20241122.173853~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F74%2F320774%2F1;p=platform%2Fcore%2Fuifw%2Fe-mod-tizen-wl-textinput.git remove ecore_thread_main_loop_begin() and end() for improving performance Change-Id: I45d184076824dc16a126709a2dff376040a6ae88 Signed-off-by: Jihoon Kim --- diff --git a/src/e_mod_input_panel.c b/src/e_mod_input_panel.c index e578a9a..9e2a447 100644 --- a/src/e_mod_input_panel.c +++ b/src/e_mod_input_panel.c @@ -1337,8 +1337,6 @@ e_input_panel_visibility_change(Eina_Bool visible) LOGI("e_input_panel_visibility_change : %d", visible); - ecore_thread_main_loop_begin(); - vconf_set_int (VCONFKEY_ISF_INPUT_PANEL_STATE, visible ? VCONFKEY_ISF_INPUT_PANEL_STATE_SHOW : VCONFKEY_ISF_INPUT_PANEL_STATE_HIDE); EINA_LIST_FOREACH(g_input_panel->surfaces, l, ips) @@ -1348,8 +1346,6 @@ e_input_panel_visibility_change(Eina_Bool visible) _e_input_panel_surface_visible_update(ips); } - ecore_thread_main_loop_end(); - _wait_update_timer_del(); } diff --git a/src/e_mod_main.c b/src/e_mod_main.c index 3ec69bd..86f944d 100644 --- a/src/e_mod_main.c +++ b/src/e_mod_main.c @@ -509,9 +509,7 @@ _input_panel_hide(struct wl_client *client, struct wl_resource *resource, Eina_B _cancel_will_hide_timer(); zone = e_zone_current_get(); - ecore_thread_main_loop_begin(); effect_run = e_input_panel_is_effect_running(); - ecore_thread_main_loop_end(); if (zone && (zone->display_state == E_ZONE_DISPLAY_STATE_OFF)) timeout = 0.0f; else if (effect_run) @@ -539,9 +537,7 @@ _input_panel_hide(struct wl_client *client, struct wl_resource *resource, Eina_B if (_context_created) _e_text_input_deactivate(text_input, input_method, EINA_FALSE); - ecore_thread_main_loop_begin(); e_input_panel_wait_update_set(EINA_FALSE); - ecore_thread_main_loop_end(); /* When the input panel surface is hidden, the candidate will hide too */ g_show_state_candidate = EINA_FALSE; @@ -1297,6 +1293,15 @@ _e_text_input_method_context_cb_resource_destroy(struct wl_resource *resource) free(context); } +static void +_input_panel_hide_async_cb(void *data) +{ + if (g_text_input && g_text_input->resource && g_client) + _input_panel_hide(g_client, g_text_input->resource, EINA_FALSE); + + g_disable_show_panel = EINA_TRUE; +} + static Eina_Bool _e_mod_ecore_key_down_cb(void *data, int type, void *event) { @@ -1353,10 +1358,7 @@ _e_mod_ecore_key_down_cb(void *data, int type, void *event) SECURE_LOGI("Hide IME (key : %s)", ev->key); - if (g_text_input && g_text_input->resource && g_client) - _input_panel_hide(g_client, g_text_input->resource, EINA_FALSE); - - g_disable_show_panel = EINA_TRUE; + ecore_main_loop_thread_safe_call_async(_input_panel_hide_async_cb, NULL); return ECORE_CALLBACK_PASS_ON; }