e_policy_stack: adjust transient_for always on top hint 94/241894/5 accepted/tizen/unified/20200827.105807 submit/tizen/20200825.123908
authorJunseok, Kim <juns.kim@samsung.com>
Wed, 19 Aug 2020 13:27:04 +0000 (22:27 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Tue, 25 Aug 2020 12:39:38 +0000 (12:39 +0000)
if use wm.policy.win.transient_for.always_on_top aux hint,
the ec's stack will be fixed topmost of transients.

Change-Id: If532356abcd2efab3df3eeaafa207e1af733c28e
Signed-off-by: Junseok, Kim <juns.kim@samsung.com>
src/bin/e_comp_wl_shell.c
src/bin/e_policy_stack.c

index f2060d4246a2cf6a0c052986ed8a2a60df1ab2e2..4fbe8bb407daee3b914246006ce7efb41e3604c3 100644 (file)
@@ -154,8 +154,9 @@ e_shell_e_client_pong(E_Client *ec)
 EINTERN void
 e_shell_e_client_parent_set(E_Client *ec, struct wl_resource *parent_resource)
 {
-   E_Client *pc;
+   E_Client *pc, *child;
    Ecore_Window pwin = 0;
+   Eina_List *dup_transients = NULL;
 
    EINA_SAFETY_ON_NULL_RETURN(ec);
 
@@ -206,6 +207,16 @@ e_shell_e_client_parent_set(E_Client *ec, struct wl_resource *parent_resource)
         ec->parent = pc;
      }
 
+   dup_transients = eina_list_clone(pc->transients);
+   EINA_LIST_FREE(dup_transients, child)
+     {
+        if (child->transient_for_always_on_top)
+          {
+             pc->transients = eina_list_remove(pc->transients, child);
+             pc->transients = eina_list_append(pc->transients, child);
+          }
+     }
+
    ec->icccm.fetch.transient_for = EINA_TRUE;
    ec->icccm.transient_for = pwin;
 }
index 6391e67715d68e3ef1ac01e29bfab7eb6a286f47..ccd021f59539f67e80b94ea51ee035900b2d70a0 100644 (file)
@@ -165,7 +165,21 @@ _e_policy_stack_transient_for_apply(E_Client *ec)
                   break;
                }
              if ((top != ec) && (eina_list_data_find(ec->parent->transients, top)))
-               break;
+               {
+                  if (top->transient_for_always_on_top)
+                    {
+                       if (e_policy_client_is_keyboard(ec) ||
+                           e_policy_client_is_keyboard_sub(ec))
+                         break;
+                       else
+                         {
+                            top = e_client_below_get(top);
+                            continue;
+                         }
+                    }
+                  else
+                    break;
+               }
              if (_e_policy_stack_transient_for_check_descendant(top, ec->parent))
                break;
 
@@ -308,8 +322,10 @@ e_policy_stack_hook_pre_fetch(E_Client *ec)
 void
 e_policy_stack_transient_for_set(E_Client *ec, E_Client *parent)
 {
+   E_Client *child = NULL;
    E_Policy_Stack *ps;
    Ecore_Window pwin = 0;
+   Eina_List *dup_transients = NULL;
 
    EINA_SAFETY_ON_NULL_RETURN(ec);
 
@@ -353,6 +369,16 @@ e_policy_stack_transient_for_set(E_Client *ec, E_Client *parent)
         ec->parent = parent;
      }
 
+   dup_transients = eina_list_clone(ec->parent->transients);
+   EINA_LIST_FREE(dup_transients, child)
+     {
+        if (child->transient_for_always_on_top)
+          {
+             ec->parent->transients = eina_list_remove(ec->parent->transients, child);
+             ec->parent->transients = eina_list_append(ec->parent->transients, child);
+          }
+     }
+
    ec->icccm.fetch.transient_for = EINA_TRUE;
    ec->icccm.transient_for = pwin;