e_client: add code to handle lowering transient_for_below window 88/261488/3
authorDoyoun Kang <doyoun.kang@samsung.com>
Tue, 20 Jul 2021 04:45:38 +0000 (13:45 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Tue, 20 Jul 2021 06:35:42 +0000 (15:35 +0900)
When a child window which set transient_for_below and belog_to_parent properties
requests to lower, e lowers it only between siblings and doesn't lower it under
the parent's sibling.

Change-Id: Ie691779c4a833926a4c196e76e53c426849364ec

src/bin/e_client.c

index 71b0b58b1f1c61d13e1a09ead54a35ddec932e68..bb4b6bde0fbd14796e283dc61838ada4dd375845 100644 (file)
@@ -8228,6 +8228,69 @@ e_client_raise(E_Client *ec)
      evas_object_raise(ec->frame);
 }
 
+static void
+_e_client_transient_for_below_group_make(E_Client *ec, Eina_List **list)
+{
+   // list : Head is the bottommost child
+   E_Client *child;
+   Eina_List *l;
+
+   if (!ec) return;
+
+   EINA_LIST_REVERSE_FOREACH(ec->transients, l, child)
+     {
+        if (!child) continue;
+        if (e_client_transient_policy_get(child) != E_TRANSIENT_BELOW) continue;
+        if (!e_client_is_belong_to_parent(child)) continue;
+
+        *list = eina_list_prepend(*list, child);
+        _e_client_transient_for_group_make(child, list);
+     }
+}
+
+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 *l = NULL;
+
+   _e_client_transient_for_below_group_make(ec, &transient_list);
+
+   if (transient_list)
+     {
+        EINA_LIST_FOREACH(transient_list, l, bottom_ec)
+          {
+             if (bottom_ec->visible)
+               break;
+          }
+        eina_list_free(transient_list);
+     }
+   return bottom_ec;
+}
+
+static void
+_lower_between_sibling_under_parent(E_Client *ec)
+{
+   E_Client *bottom_child = NULL;
+   bottom_child = e_client_transient_child_bottom_get(ec->parent);
+   if (!bottom_child)
+     {
+        ELOGF("POL", "LOWER child window between sibling... Stack below under the parent (win:%zx, ec:%p)", ec, e_client_util_win_get(ec->parent), ec->parent);
+        e_client_stack_below(ec, ec->parent);
+     }
+   else
+     {
+        if (bottom_child != ec)
+          {
+             ELOGF("POL", "LOWER child window between sibling... Stack below under the bottom child (win:%zx, ec:%p)", ec, e_client_util_win_get(bottom_child), bottom_child);
+             e_client_stack_below(ec, bottom_child);
+          }
+        else
+          ELOGF("POL", "LOWER child window between sibling... already under the bottom. STAY", ec);
+     }
+}
+
 static void
 _lower_between_sibling_on_parent(E_Client *ec)
 {
@@ -8238,7 +8301,10 @@ _lower_between_sibling_on_parent(E_Client *ec)
 static void
 _lower_belong_to_parent(E_Client *ec)
 {
-   _lower_between_sibling_on_parent(ec);
+   if (e_client_transient_policy_get(ec) == E_TRANSIENT_BELOW)
+     _lower_between_sibling_under_parent(ec);
+   else
+     _lower_between_sibling_on_parent(ec);
 }
 
 E_API void