Use a parent window instead of a focused one to support AoT 21/306221/3
authorInhong Han <inhong1.han@samsung.com>
Fri, 16 Feb 2024 04:21:12 +0000 (13:21 +0900)
committerInhong Han <inhong1.han@samsung.com>
Wed, 21 Feb 2024 10:28:43 +0000 (19:28 +0900)
Change-Id: Ice6d899e3805731af46471b193c5cef804bd9f90

src/e_mod_input_panel.c

index b35ecc5..95f5b2d 100644 (file)
@@ -240,7 +240,7 @@ _e_input_panel_surface_show(E_Input_Panel_Surface *ips)
 {
    Eina_List *l = NULL;
    E_Input_Panel_Surface *surface = NULL;
-   E_Client *focused_ec = NULL;
+   E_Client *focused_ec = e_client_focused_get();
 
    if (!g_input_panel) return;
 
@@ -251,7 +251,8 @@ _e_input_panel_surface_show(E_Input_Panel_Surface *ips)
           {
              if (surface && surface->ec)
                {
-                  if (surface->ec->parent == e_client_focused_get())
+                  if (surface->ec->parent == focused_ec ||
+                      (focused_ec && surface->ec->parent == focused_ec->parent))
                     {
                        ips = surface;
                     }
@@ -262,16 +263,15 @@ _e_input_panel_surface_show(E_Input_Panel_Surface *ips)
    if (!ips) return;
 
    LOGI("parent:%p, focus:%p, wait_update %d\n",
-        ips->ec ? ips->ec->parent : NULL, e_client_focused_get(), g_input_panel->wait_update);
+        ips->ec ? ips->ec->parent : NULL, focused_ec, g_input_panel->wait_update);
 
    if (g_input_panel->wait_update)
      {
-        focused_ec = e_client_focused_get();
         e_input_panel_wait_update_set(EINA_FALSE);
         if (ips->ec && ips->ec->parent)
           {
-             LOGI("focused_ec:%p, ec->parent:%p, ec->parent->parent: %p\n", focused_ec, ips->ec->parent, ips->ec->parent->parent);
-             if (ips->ec->parent == focused_ec || ips->ec->parent->parent == focused_ec)
+             LOGI("focused_ec:%p, focused_ec->parent:%p, ec->parent:%p\n", focused_ec, focused_ec ? focused_ec->parent : NULL, ips->ec->parent);
+             if (ips->ec->parent == focused_ec || (focused_ec && ips->ec->parent == focused_ec->parent))
                {
                   e_policy_conformant_part_update(ips->ec);
                   e_input_panel_visibility_change(EINA_TRUE);
@@ -1418,10 +1418,12 @@ e_input_panel_wait_update_set(Eina_Bool wait_update)
 EINTERN void
 e_input_panel_transient_for_set(E_Client *parent)
 {
-   LOGI("TRANSIENT_FOR::transient_for_set : %p\n", parent);
    E_Input_Panel_Surface *ips;
    Eina_List *l;
-   E_Client *ec_parent = parent;
+   E_Client *parent_window = (parent && parent->parent) ? parent->parent : parent;
+   E_Client *ec_parent = parent_window;
+
+   LOGI("TRANSIENT_FOR::transient_for_set : parent(%p), parent window(%p)\n", parent, parent_window);
 
    /* finding the actual parent window that contains the remote surface. */
    if (ec_parent)
@@ -1466,7 +1468,7 @@ e_input_panel_transient_for_set(E_Client *parent)
         /* Append our child into parent's transients list */
         if ((ec_parent != child) && (ec_parent != child->parent))
           {
-             if ((ec_parent) && (eina_list_data_find(parent->transients, child) != child))
+             if ((ec_parent) && (eina_list_data_find(parent_window->transients, child) != child))
                {
                   LOGI("TRANSIENT_FOR::Adding %p into parent %p's transients list\n", child, ec_parent);
                   ec_parent->transients = eina_list_append(ec_parent->transients, child);