e_policy_stack: fix bug for stacking transient children 04/215704/2
authorDoyoun Kang <doyoun.kang@samsung.com>
Mon, 14 Oct 2019 09:51:40 +0000 (18:51 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Mon, 14 Oct 2019 10:30:18 +0000 (19:30 +0900)
When there existed the 1st transient child and its child,
the 2nd transient child is placed above the 1st transient child not the child of the 1st transient child.

According to our policy,
the 2nd transient child should be placed above the 1st transient child and its children.
So, we fix this.

Change-Id: I2ae2eba5d499318d5869258e9fe0590fe4adb29d

src/bin/e_policy_stack.c

index f1117969c084a23289bb58b67c9c26e20ab460c9..885040161208f15b59166b8bc8a1417b7c8d0375 100644 (file)
@@ -49,6 +49,29 @@ _e_policy_stack_data_del(E_Client *ec)
      }
 }
 
+Eina_Bool
+_e_policy_stack_transient_for_check_descendant(E_Client *ec, E_Client *ancestor)
+{
+   E_Client *parent = NULL;
+   Eina_Bool is_descendant = EINA_FALSE;
+
+   if (!ec) return EINA_FALSE;
+   if (!ancestor) return EINA_FALSE;
+
+   parent = ec->parent;
+   while (parent)
+     {
+        if (parent && (eina_list_data_find(ancestor->transients, parent)))
+          {
+             is_descendant = EINA_TRUE;
+             break;
+          }
+        parent = parent->parent;
+     }
+
+   return is_descendant;
+}
+
 void
 _e_policy_stack_transient_for_apply(E_Client *ec)
 {
@@ -113,6 +136,8 @@ _e_policy_stack_transient_for_apply(E_Client *ec)
                }
              if ((top != ec) && (eina_list_data_find(ec->parent->transients, top)))
                break;
+             if (_e_policy_stack_transient_for_check_descendant(top, ec->parent))
+               break;
 
              top = e_client_below_get(top);
           }