From 536cc3f78dabf4ea31cea01cb23878ea3f2c975d Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Wed, 12 Aug 2020 20:11:27 +0900 Subject: [PATCH] Send input panel geometry in finishing moving floating IME Change-Id: Id354c84b7029129ed13982c2a1c72a3d68c76c06 Signed-off-by: Jihoon Kim --- src/e_mod_input_panel.c | 3 +++ src/e_mod_main.c | 43 ++++++++++++++++++++++++++----------------- src/e_mod_main.h | 1 + 3 files changed, 30 insertions(+), 17 deletions(-) diff --git a/src/e_mod_input_panel.c b/src/e_mod_input_panel.c index cd0a1a9..2abaaa8 100644 --- a/src/e_mod_input_panel.c +++ b/src/e_mod_input_panel.c @@ -939,6 +939,9 @@ _e_ips_cb_mouse_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED g_floating_info->mouse_pressed = EINA_FALSE; g_floating_info->moving_req = EINA_FALSE; + + LOGD("[Mouse up] Send input panel geometry"); + e_text_input_update_input_panel_geometry(ec); } static void diff --git a/src/e_mod_main.c b/src/e_mod_main.c index ad16c0b..a2a2745 100644 --- a/src/e_mod_main.c +++ b/src/e_mod_main.c @@ -2392,7 +2392,6 @@ _e_text_input_method_context_cb_client_resize(void *data EINA_UNUSED, int type E E_Event_Client *ev; E_Client *ec; Eina_Bool found; - int x = 0, y = 0, w = 0, h = 0; ev = (E_Event_Client *)event; EINA_SAFETY_ON_NULL_RETURN_VAL(ev, ECORE_CALLBACK_PASS_ON); @@ -2404,22 +2403,7 @@ _e_text_input_method_context_cb_client_resize(void *data EINA_UNUSED, int type E if (!found) return ECORE_CALLBACK_PASS_ON; if ((ec->w < 1) && (ec->h < 1)) return ECORE_CALLBACK_PASS_ON; - if (g_text_input && g_text_input->resource && - g_input_panel_state != E_INPUT_PANEL_STATE_WILL_HIDE && g_input_panel_state != E_INPUT_PANEL_STATE_DID_HIDE && - g_updated_geometry) - { - if (e_client_rotation_is_progress(ec)) - { - LOGD("Rotation is not finished"); - return ECORE_CALLBACK_PASS_ON; - } - - /* The geometry of E_Client may not be valid when IME is shown. - Assume E_Client has a valid geometry when this callback is called after IME has set the size. - */ - if (e_input_panel_client_geometry_get(NULL, &x, &y, &w, &h) && !(w <= 1 || h <= 1)) - _e_text_input_send_input_panel_geometry(g_text_input->resource, x, y, w, h); - } + e_text_input_update_input_panel_geometry(ec); return ECORE_CALLBACK_PASS_ON; } @@ -2480,6 +2464,31 @@ e_text_input_update_input_panel_state(Eina_Bool state) } } +void +e_text_input_update_input_panel_geometry(E_Client *ec) +{ + if (g_text_input && g_text_input->resource && + g_input_panel_state != E_INPUT_PANEL_STATE_WILL_HIDE && g_input_panel_state != E_INPUT_PANEL_STATE_DID_HIDE && + g_updated_geometry) + { + if (e_client_rotation_is_progress(ec)) + { + LOGD("Rotation is not finished"); + return; + } + + /* The geometry of E_Client may not be valid when IME is shown. + Assume E_Client has a valid geometry when this callback is called after IME has set the size. + */ + int x = 0, y = 0, w = 0, h = 0; + if (e_input_panel_client_geometry_get(NULL, &x, &y, &w, &h) && !(w <= 1 || h <= 1)) + { + LOGD("x : %d, y : %d, w : %d, h : %d", x, y, w, h); + _e_text_input_send_input_panel_geometry(g_text_input->resource, x, y, w, h); + } + } +} + E_API void * e_modapi_init(E_Module *m) { diff --git a/src/e_mod_main.h b/src/e_mod_main.h index ddf93a5..ce5311b 100644 --- a/src/e_mod_main.h +++ b/src/e_mod_main.h @@ -22,6 +22,7 @@ EINTERN void e_input_panel_transient_for_set(E_Client *parent); void e_input_panel_show_need_rerun_set(Eina_Bool need_rerun); void e_input_panel_floating_position_set(int x, int y); void e_text_input_update_input_panel_state(Eina_Bool state); +void e_text_input_update_input_panel_geometry(E_Client *ec); Eina_Bool e_input_panel_surface_destroy(E_Client *ec); int e_input_panel_is_effect_running(void); -- 2.7.4