From: Jihoon Kim Date: Wed, 12 Aug 2020 11:11:27 +0000 (+0900) Subject: Send input panel geometry in finishing moving floating IME X-Git-Tag: submit/tizen_5.0/20200818.012652~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9153f346474b26068825cc35040c19e7e64d66d7;p=platform%2Fcore%2Fuifw%2Fe-mod-tizen-wl-textinput.git Send input panel geometry in finishing moving floating IME Change-Id: Id354c84b7029129ed13982c2a1c72a3d68c76c06 Signed-off-by: Jihoon Kim --- diff --git a/src/e_mod_input_panel.c b/src/e_mod_input_panel.c index 95a78c3..cac13b0 100644 --- a/src/e_mod_input_panel.c +++ b/src/e_mod_input_panel.c @@ -910,6 +910,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 c545e0a..56f1de4 100644 --- a/src/e_mod_main.c +++ b/src/e_mod_main.c @@ -2305,13 +2305,23 @@ _e_mod_eeze_udev_watch_cb(const char *text, Eeze_Udev_Event event, void *data, E set_soft_keyboard_mode(); } +static Eina_Bool +e_client_rotation_is_progress(E_Client *ec) +{ + if (!ec) return EINA_TRUE; + + if (ec->e.state.rot.ang.next == -1) + return EINA_FALSE; + else + return EINA_TRUE; +} + static Eina_Bool _e_text_input_method_context_cb_client_resize(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) { 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); @@ -2323,11 +2333,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) - { - 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; } @@ -2388,6 +2394,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 1ad4a2a..6d540b4 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);