e_client/e_policy_wl: refactoring ec's transient_for_always_on_parent value 67/261467/2
authorDoyoun Kang <doyoun.kang@samsung.com>
Mon, 19 Jul 2021 11:48:16 +0000 (20:48 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Mon, 19 Jul 2021 11:54:05 +0000 (20:54 +0900)
1. Rename E_Client's internal value
   -  "belong_to_parent" from "transient_for_always_on_parent"
2. Add below APIs for setting/getting belong_to_parent property
   - e_client_belong_to_parent_set
   - e_client_is_belong_to_parent
3. Change relating aux hint key
   - "wm.policy.win.belong_to_parent" from "wm.policy.win.transient_for.always_on_parent"

Change-Id: I9a6fe63d91d911b84f99149cf35c7ec0bcd9f326

src/bin/e_client.c
src/bin/e_client.h
src/bin/e_policy_wl.c

index 232261550dff0518a965b10e3324ade6bfe3136b..d0454fdc2cbc86c568e6478cc2bdb7cea7a6fe73 100644 (file)
@@ -8212,7 +8212,7 @@ e_client_raise(E_Client *ec)
           }
      }
 
-   if (ec->parent && ec->transient_for_always_on_parent)
+   if (ec->parent && e_client_is_belong_to_parent(ec))
      _raise_belong_to_parent(ec);
    else
      evas_object_raise(ec->frame);
@@ -8247,7 +8247,7 @@ e_client_lower(E_Client *ec)
           }
      }
 
-   if (ec->parent && ec->transient_for_always_on_parent)
+   if (ec->parent && e_client_is_belong_to_parent(ec))
      _lower_belong_to_parent(ec);
    else
      evas_object_lower(ec->frame);
@@ -8437,6 +8437,20 @@ e_client_map_enable_set(E_Client *ec, Eina_Bool enable)
    return EINA_TRUE;
 }
 
+EINTERN void
+e_client_belong_to_parent_set(E_Client *ec, Eina_Bool set)
+{
+   if (!ec) return;
+   ec->belong_to_parent = set;
+}
+
+E_API Eina_Bool
+e_client_is_belong_to_parent(E_Client *ec)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
+   return ec->belong_to_parent;
+}
+
 E_API void
 e_client_transient_policy_set(E_Client *ec, E_Transient policy)
 {
index c1be87dac2d06ff3a4984e1190477c39fba38003..d5798c5c702abb8b6ca8a6ae2f4198489dcf3b93 100644 (file)
@@ -1017,7 +1017,7 @@ struct E_Client
    } desk_group;
 
    Eina_Bool transient_for_always_on_top;
-   Eina_Bool transient_for_always_on_parent;
+   Eina_Bool belong_to_parent;
    struct
    {
       int count;
@@ -1275,6 +1275,9 @@ E_API Eina_Bool        e_client_map_set(E_Client *ec, E_Map *em);
 E_API E_Map           *e_client_map_get(const E_Client *ec);
 E_API Eina_Bool        e_client_map_enable_set(E_Client *ec, Eina_Bool enabled);
 
+EINTERN void e_client_belong_to_parent_set(E_Client *ec, Eina_Bool set);
+E_API Eina_Bool e_client_is_belong_to_parent(E_Client *ec);
+
 E_API void e_client_transient_policy_set(E_Client *ec, E_Transient policy);
 E_API E_Transient e_client_transient_policy_get(E_Client *ec);
 
index be8f112b6d245dc5ff5b47bae9b974429d21b454..f568cfc40dd45a86f4edc8ee0209ef52441afd6f 100644 (file)
@@ -253,7 +253,7 @@ enum _E_Policy_Hint_Type
    E_POLICY_HINT_ROT_RENDER_NOPENDING = 10,
    E_POLICY_HINT_ICONIFY_BUFFER_FLUSH = 11,
    E_POLICY_HINT_TRANSIENT_FOR_ALWAYS_ON_TOP = 12,
-   E_POLICY_HINT_TRANSIENT_FOR_ALWAYS_ON_PARENT = 13,
+   E_POLICY_HINT_BELONG_TO_PARENT = 13,
 };
 
 static const char *hint_names[] =
@@ -271,7 +271,7 @@ static const char *hint_names[] =
    "wm.policy.win.rot.render.nopending",
    "wm.policy.win.iconify.buffer.flush",
    "wm.policy.win.transient_for.always_on_top",
-   "wm.policy.win.transient_for.always_on_parent",
+   "wm.policy.win.belong_to_parent",
 };
 
 static void                _e_policy_wl_surf_del(E_Policy_Wl_Surface *psurf);
@@ -2420,17 +2420,17 @@ _e_policy_wl_aux_hint_apply(E_Client *ec)
                   ec->transient_for_always_on_top = EINA_FALSE;
                }
           }
-        else if (!strncmp(hint->hint, hint_names[E_POLICY_HINT_TRANSIENT_FOR_ALWAYS_ON_PARENT], strlen(hint->hint)))
+        else if (!strncmp(hint->hint, hint_names[E_POLICY_HINT_BELONG_TO_PARENT], strlen(hint->hint)))
           {
              if (!strncmp(hint->val, "1", 1))
                {
-                  ELOGF("TF_SET", "Transient for Always_on_parent enabled", ec);
-                  ec->transient_for_always_on_parent = EINA_TRUE;
+                  ELOGF("TF_SET", "Set belong_to_parent", ec);
+                  e_client_belong_to_parent_set(ec, EINA_TRUE);
                }
              else
                {
-                  ELOGF("TF_SET", "Transient for Always_on_parent disabled", ec);
-                  ec->transient_for_always_on_parent = EINA_FALSE;
+                  ELOGF("TF_SET", "Unset belong_to_parent", ec);
+                  e_client_belong_to_parent_set(ec, EINA_FALSE);
                }
           }
      }