remove ecore_thread_main_loop_begin() and end() for improving performance 74/320774/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Fri, 22 Nov 2024 05:19:41 +0000 (14:19 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Fri, 22 Nov 2024 06:27:08 +0000 (15:27 +0900)
Change-Id: I45d184076824dc16a126709a2dff376040a6ae88
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
src/e_mod_input_panel.c
src/e_mod_main.c

index e578a9a42a4805daeb5627f1aa62b3b264171193..9e2a44775ff7504f5e97a282ff656e44d6378129 100644 (file)
@@ -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();
 }
 
index 3ec69bd3f39aa00a5d77e3c8416dabb3c18b6f61..86f944de7c41682c8c9cc0b90433e5e0db5c1513 100644 (file)
@@ -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;
 }