e_client: fix transient_for_below bug for lowering child window 62/261662/1 accepted/tizen/unified/20210723.122653 submit/tizen/20210722.095947 submit/tizen/20210723.001953
authorDoyoun Kang <doyoun.kang@samsung.com>
Thu, 22 Jul 2021 07:26:25 +0000 (16:26 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Thu, 22 Jul 2021 07:26:29 +0000 (16:26 +0900)
There was a bug that the children list was wrong when the parent was raised.
The bug scenario is as below.
1. One of transient_for_below children requests to lower
2. The parent of it requests to raise
Then, the parent is raised with wrong stack of transient_for_below children.

This patch will fix it.

Change-Id: Ifa92967e741bd90f4d3e5fb375bb64a63357185d

src/bin/e_client.c
src/bin/e_test_helper.c

index ab752ff2a78865749a01d6b1eeaa380f6fb2809e..01d4e8eccb1ed30c2f6a45d76837527d15b4e611 100644 (file)
@@ -8251,19 +8251,36 @@ E_API E_Client *
 e_client_transient_child_bottom_get(E_Client *ec)
 {
    E_Client *bottom_ec = NULL;
-   Eina_List *transient_list = NULL;
+   Eina_List *transient_below_list = NULL;
    Eina_List *l = NULL;
 
-   _e_client_transient_for_below_group_make(ec, &transient_list);
+   _e_client_transient_for_below_group_make(ec, &transient_below_list);
 
-   if (transient_list)
+   if (transient_below_list)
      {
-        EINA_LIST_FOREACH(transient_list, l, bottom_ec)
+        E_Client *temp_ec = NULL;
+        E_Client *temp_ec2 = NULL;
+
+        E_CLIENT_FOREACH(temp_ec)
           {
-             if (bottom_ec->visible)
-               break;
+             if (bottom_ec) break;
+
+             if (temp_ec == ec)
+               {
+                  bottom_ec = ec;
+                  break;
+               }
+
+             EINA_LIST_FOREACH(transient_below_list, l, temp_ec2)
+               {
+                  if (temp_ec == temp_ec2)
+                    {
+                       bottom_ec = temp_ec2;
+                       break;
+                    }
+               }
           }
-        eina_list_free(transient_list);
+        eina_list_free(transient_below_list);
      }
    return bottom_ec;
 }
index 8fdd8affd6b3be305318e15056baa8dead22a5b2..5906daa9cfe2acca3ecbb3a40691b14bccd6eca5 100644 (file)
@@ -463,9 +463,19 @@ _e_test_helper_restack(Ecore_Window win, Ecore_Window target, int above)
    if(!tec)
      {
         if (above)
-          e_client_raise(ec);
+          {
+             if (ec->parent)
+               e_policy_stack_transient_child_raise(ec);
+
+             e_client_raise(ec);
+          }
         else
-          e_client_lower(ec);
+          {
+             if (ec->parent)
+               e_policy_stack_transient_child_lower(ec);
+
+             e_client_lower(ec);
+          }
      }
    else
      {