Modified to prevent deleted client to set transient_for 33/196533/1
authorInhong Han <inhong1.han@samsung.com>
Wed, 2 Jan 2019 02:24:04 +0000 (11:24 +0900)
committerInHong Han <inhong1.han@samsung.com>
Wed, 2 Jan 2019 06:17:22 +0000 (06:17 +0000)
Change-Id: Ic65b4ae77ef8a3fa136179688af8cb191e27c402
(cherry picked from commit 14101bfccbcacc14f3758fb671b87858b317b5d9)

src/e_mod_input_panel.c
src/e_mod_main.c
src/e_mod_main.h

index c18bfe2..939d34a 100644 (file)
@@ -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;
+}
index 1258da4..d529719 100644 (file)
@@ -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)
           {
index 50c68fe..acf2255 100644 (file)
@@ -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,