From 68bada7f1850410eeb519b93d2ff7bedf63c12ae Mon Sep 17 00:00:00 2001 From: Doyoun Kang Date: Fri, 22 Nov 2019 09:15:00 +0900 Subject: [PATCH] e_mod_input_panel: add code to sync resizing window using rotation_geometry_set hook Change-Id: I706beb96d6ad7b742945a0c302a50be554a66451 --- src/e_mod_input_panel.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/src/e_mod_input_panel.c b/src/e_mod_input_panel.c index aa4a689..3970d87 100644 --- a/src/e_mod_input_panel.c +++ b/src/e_mod_input_panel.c @@ -50,6 +50,7 @@ struct _E_Input_Panel_Surface Ecore_Timer *resize_timer; E_Client_Hook *hook_del; + E_Policy_Hook *hook_rotation_geometry_set; }; struct _E_Input_Panel_Floating_Info @@ -427,6 +428,7 @@ _e_input_panel_surface_resource_destroy(struct wl_resource *resource) E_FREE_FUNC(ips->eh.rot_change_end, ecore_event_handler_del); E_FREE_FUNC(ips->eh.buf_change, ecore_event_handler_del); E_FREE_FUNC(ips->hook_del, e_client_hook_del); + E_FREE_FUNC(ips->hook_rotation_geometry_set, e_policy_hook_del); free(ips); } @@ -660,6 +662,11 @@ _e_input_panel_surface_visible_update(E_Input_Panel_Surface *ips) if (_e_input_panel_is_effect_running(ips->ec)) ips->need_show = EINA_TRUE; + else if (ips->resizing) + { + LOGD("Keyboard is currently resizing. set need_show."); + ips->need_show = EINA_TRUE; + } else { _ips_show(ips->ec); @@ -973,6 +980,43 @@ _e_ips_cb_mouse_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *ev } static void +_e_input_panel_rotation_geometry_set(void *data, E_Client *ec) +{ + E_Input_Panel_Surface *ips; + int i; + int w, h; + int cur_angle; + + ips = data; + if (!ips) return; + + if (ec != ips->ec) + return; + + if (ips->resizing) + return; + + evas_object_geometry_get(ec->frame, NULL, NULL, &w, &h); + + cur_angle = ec->e.state.rot.ang.curr; + switch (cur_angle) + { + case 0: i = 0; break; + case 90: i = 1; break; + case 180: i = 2; break; + case 270: i = 3; break; + default: i = 0; break; + } + + if ((w != ec->e.state.rot.geom[i].w) || + (h != ec->e.state.rot.geom[i].h)) + { + LOGD("Resizing by Rotation Geometry. Pending Drawing..."); + _e_input_panel_stop_drawing(ips); + } +} + +static void _e_input_panel_cb_surface_get(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *surface_resource) { E_Input_Panel *input_panel = wl_resource_get_user_data(resource); @@ -1088,6 +1132,7 @@ _e_input_panel_cb_surface_get(struct wl_client *client, struct wl_resource *reso ips->hook_del = e_client_hook_add(E_CLIENT_HOOK_DEL, _e_input_panel_client_cb_remove, ips); + ips->hook_rotation_geometry_set = e_policy_hook_add(E_POLICY_HOOK_CLIENT_ROTATION_GEOMETRY_SET, _e_input_panel_rotation_geometry_set, ips); // base_output_resolution. e_client_base_output_resolution_update(ec); @@ -1270,6 +1315,8 @@ _e_input_panel_idle_enter(void *data) { if (!_e_input_panel_is_effect_running(ips->ec)) { + if (ips->resizing) + continue; _ips_show(ips->ec); ips->need_show = EINA_FALSE; } -- 2.7.4