From: Inhong Han Date: Wed, 2 Jan 2019 02:24:04 +0000 (+0900) Subject: Modified to prevent deleted client to set transient_for X-Git-Tag: accepted/tizen/unified/20190108.062236~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e84e08679512859a9fa47c63371e1770b8e4c432;p=platform%2Fcore%2Fuifw%2Fe-mod-tizen-wl-textinput.git Modified to prevent deleted client to set transient_for Change-Id: Ic65b4ae77ef8a3fa136179688af8cb191e27c402 (cherry picked from commit 14101bfccbcacc14f3758fb671b87858b317b5d9) --- diff --git a/src/e_mod_input_panel.c b/src/e_mod_input_panel.c index c18bfe2..939d34a 100644 --- a/src/e_mod_input_panel.c +++ b/src/e_mod_input_panel.c @@ -299,6 +299,7 @@ static const struct wl_input_panel_surface_interface _e_input_panel_surface_impl static void _e_input_panel_surface_resource_destroy(struct wl_resource *resource) { + LOGD(""); E_Input_Panel_Surface *ips = wl_resource_get_user_data(resource); E_Input_Panel *input_panel = NULL; E_Client *ec = NULL; @@ -1308,3 +1309,24 @@ e_input_panel_floating_position_set(E_Client *ec, int x, int y) break; } } + +Eina_Bool +e_input_panel_surface_destroy(E_Client *ec) +{ + E_Input_Panel_Surface *ips; + Eina_List *l; + Eina_List *l_next; + + if (!g_input_panel) return EINA_FALSE; + + EINA_LIST_FOREACH_SAFE(g_input_panel->surfaces, l, l_next, ips) + { + if (!ips->ec) continue; + if (ips->ec == ec) + { + g_input_panel->surfaces = eina_list_remove_list(g_input_panel->surfaces, l); + } + } + + return EINA_TRUE; +} diff --git a/src/e_mod_main.c b/src/e_mod_main.c index 1258da4..d529719 100644 --- a/src/e_mod_main.c +++ b/src/e_mod_main.c @@ -2339,6 +2339,10 @@ _pol_cb_hook_client_del(void *d EINA_UNUSED, E_Client *ec) LOGD("transient_for_ec deleted, hiding input panel\n"); e_input_panel_visibility_change(EINA_FALSE); e_input_panel_transient_for_set(NULL); + + if(!e_input_panel_surface_destroy(ec)) + LOGW("fail to remove surface\n"); + g_input_panel_state = E_INPUT_PANEL_STATE_DID_HIDE; if (g_timer_will_hide) { diff --git a/src/e_mod_main.h b/src/e_mod_main.h index 50c68fe..acf2255 100644 --- a/src/e_mod_main.h +++ b/src/e_mod_main.h @@ -21,8 +21,8 @@ EINTERN void e_input_panel_wait_update_set(Eina_Bool wait_update); 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(E_Client *ec, int x, int y); - void e_text_input_update_input_panel_state(Eina_Bool state); +Eina_Bool e_input_panel_surface_destroy(E_Client *ec); typedef enum { TIZEN_PROFILE_UNKNOWN = 0,