Revert "e_client: Checks if it's valid operation for sub-surface." 44/246844/1
authorDoyoun Kang <doyoun.kang@samsung.com>
Wed, 4 Nov 2020 11:53:10 +0000 (20:53 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Wed, 4 Nov 2020 11:53:15 +0000 (20:53 +0900)
This reverts commit 1cf2f111f9ff9a1043cde8c0f201ee53d74ef0a4.

Change-Id: Id3b909374118cec52d862cf0ad03272c0db8f1a7

src/bin/e_client.c
src/bin/e_comp_wl_subsurface.c
src/bin/e_comp_wl_subsurface.h
src/bin/e_policy_stack.c

index 32066e6c4c421a0864643d60c8b4af01f6c812b0..856e707bed487381f250a33c96aa4cc3cd353cb7 100644 (file)
@@ -8111,10 +8111,6 @@ e_client_raise(E_Client *ec)
 {
    if (!ec) return;
 
-   /* Do not mess up the stacking order of sub-surfaces. */
-   if (e_comp_wl_subsurface_check(ec))
-     return;
-
    if (ec->desk_group.enable)
      {
         E_Desk_Group *edg;
@@ -8134,10 +8130,6 @@ e_client_lower(E_Client *ec)
 {
    if (!ec) return;
 
-   /* Do not mess up the stacking order of sub-surfaces. */
-   if (e_comp_wl_subsurface_check(ec))
-     return;
-
    if (ec->desk_group.enable)
      {
         E_Desk_Group *edg;
@@ -8160,21 +8152,6 @@ e_client_stack_above(E_Client *ec, E_Client *above)
    if (!above) return;
    if (!above->frame) return;
 
-   /* If at least one of the given clients is sub-surface. */
-   if ((e_comp_wl_subsurface_check(ec)) ||
-       (e_comp_wl_subsurface_check(above)))
-     {
-        /* Both should be sibling. */
-        if (!e_comp_wl_subsurface_sibling_check(ec, above))
-          {
-             ELOGF("CLIENT", "Invalid operation: given clients are not sibling."
-                   "\nec(%p, parent: %p) above(%p, parent: %p)",
-                   ec, ec, e_comp_wl_subsurface_parent_get(ec),
-                   above, e_comp_wl_subsurface_parent_get(above));
-             return;
-          }
-     }
-
    if (ec->desk_group.enable)
      {
         E_Desk_Group *edg;
@@ -8187,12 +8164,6 @@ e_client_stack_above(E_Client *ec, E_Client *above)
      }
 
    evas_object_stack_above(ec->frame, above->frame);
-
-   /* Since calling evas_object_stack_above() messes up the stacking order of
-    * sub-surface of above, it should be updated. */
-   if ((above->comp_data->sub.list) &&
-       (eina_list_count(above->comp_data->sub.list) > 0))
-     e_comp_wl_subsurface_stack_update(above);
 }
 
 E_API void
@@ -8203,21 +8174,6 @@ e_client_stack_below(E_Client *ec, E_Client *below)
    if (!below) return;
    if (!below->frame) return;
 
-   /* If at least one of the given clients is sub-surface. */
-   if ((e_comp_wl_subsurface_check(ec)) ||
-       (e_comp_wl_subsurface_check(below)))
-     {
-        /* Both should be sibling. */
-        if (!e_comp_wl_subsurface_sibling_check(ec, below))
-          {
-             ELOGF("CLIENT", "Invalid operation: given clients are not sibling."
-                   "\nec(%p, parent: %p) below(%p, parent: %p)",
-                   ec, ec, e_comp_wl_subsurface_parent_get(ec),
-                   below, e_comp_wl_subsurface_parent_get(below));
-             return;
-          }
-     }
-
    if (ec->desk_group.enable)
      {
         E_Desk_Group *edg;
@@ -8230,12 +8186,6 @@ e_client_stack_below(E_Client *ec, E_Client *below)
      }
 
    evas_object_stack_below(ec->frame, below->frame);
-
-   /* Since calling evas_object_stack_below() messes up the stacking order of
-    * sub-surface of below, it should be updated. */
-   if ((below->comp_data->sub.below_list) &&
-       (eina_list_count(below->comp_data->sub.below_list) > 0))
-     e_comp_wl_subsurface_stack_update(below);
 }
 
 E_API int
index aa9991cc4e6ca5fe312b9460044ab22cf325dd26..ea7b903e171ce716a89c04a998710c20d8e207b3 100644 (file)
@@ -49,9 +49,6 @@ _e_comp_wl_subsurface_restack(E_Client *ec)
 
    if (!ec || !ec->comp_data || e_object_is_del(E_OBJECT(ec))) return;
 
-   if (ec->comp_data->sub.restacking)
-       return;
-
    ec->comp_data->sub.restacking = EINA_TRUE;
 
    temp = ec;
@@ -1294,71 +1291,6 @@ e_comp_wl_subsurface_check_below_bg_rectangle(E_Client *ec)
    _e_comp_wl_subsurface_check_below_bg_rectangle(ec);
 }
 
-EINTERN Eina_Bool
-e_comp_wl_subsurface_check(E_Client *ec)
-{
-   EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
-
-   return (_e_comp_wl_subsurface_data_get(ec) != NULL) ? EINA_TRUE : EINA_FALSE;
-}
-
-EINTERN E_Client *
-e_comp_wl_subsurface_parent_get(E_Client *ec)
-{
-   E_Comp_Wl_Subsurf_Data *sdata;
-
-   EINA_SAFETY_ON_NULL_RETURN_VAL(ec, NULL);
-
-   sdata = _e_comp_wl_subsurface_data_get(ec);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(sdata, NULL);
-
-   return sdata->parent;
-}
-
-EINTERN Eina_Bool
-e_comp_wl_subsurface_sibling_check(E_Client *ec1, E_Client *ec2)
-{
-   E_Comp_Wl_Subsurf_Data *sd1, *sd2;
-
-   EINA_SAFETY_ON_NULL_RETURN_VAL(ec1, EINA_FALSE);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(ec2, EINA_FALSE);
-
-   sd1 = _e_comp_wl_subsurface_data_get(ec1);
-   /* ec1 is sub-surface. */
-   if (sd1)
-     {
-        /* ec2 is the parent of ec1. */
-        if (sd1->parent == ec2)
-          return EINA_TRUE;
-
-        sd2 = _e_comp_wl_subsurface_data_get(ec2);
-        if (sd2)
-          {
-             /* ec1 is the parent of ec2. */
-             if (sd2->parent == ec1)
-               return EINA_TRUE;
-
-             /* both have same parent. */
-             if (sd1->parent == sd2->parent)
-               return EINA_TRUE;
-          }
-     }
-   /* ec1 is not sub-surface. */
-   else
-     {
-        sd2 = _e_comp_wl_subsurface_data_get(ec2);
-        /* ec2 is sub-surface. */
-        if (sd2)
-          {
-             /* ec1 is the parent of ec2. */
-             if (sd2->parent == ec1)
-               return EINA_TRUE;
-          }
-     }
-
-   return EINA_FALSE;
-}
-
 static void
 _e_comp_wl_subsurface_cb_dummy_destroy(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
 {
index d137c44408957dee73e80aba649fc5ef2af2b404..6f1938793594c74d78b6457d3279956307675119 100644 (file)
@@ -25,27 +25,4 @@ EINTERN Eina_Bool     e_comp_wl_video_subsurface_has(E_Client *ec);
 EINTERN Eina_Bool     e_comp_wl_normal_subsurface_has(E_Client *ec);
 EINTERN void          e_comp_wl_subsurface_check_below_bg_rectangle(E_Client *ec);
 
-/**
- * @brief   Checks if given ec is sub-surface.
- * @in  ec  The E_Client instance to be checked.
- * @return  EINA_TRUE if it's sub-surface. Otherwise, EINA_FALSE.
- */
-EINTERN Eina_Bool     e_comp_wl_subsurface_check(E_Client *ec);
-
-/** 
- * @brief   Gets the parent of a ec.
- * @in  ec  The E_Client instance.
- * @return  The E_Client instance of parent.
- */
-EINTERN E_Client     *e_comp_wl_subsurface_parent_get(E_Client *ec);
-
-/** 
- * @brief   Checks if given two clients are siblings
- *          or the one of two is a parent.
- * @in  ec1 The E_Client instance to be checked.
- * @in  ec2 The another one E_Client instance to be checked.
- * @return  EINA_TRUE if these are sibling. Otherwise, EINA_FALSE.
- */
-EINTERN Eina_Bool     e_comp_wl_subsurface_sibling_check(E_Client *ec1, E_Client *ec2);
-
 #endif
index f9a2f1e588f09126dc4b7f4f6d5c7056258bcbd3..aaf16370dfe904ed8d988492071f3bd6e4a0f93a 100644 (file)
@@ -469,6 +469,7 @@ e_policy_stack_below(E_Client *ec, E_Client *below_ec)
    EINA_SAFETY_ON_NULL_RETURN(below_ec->frame);
 
    e_client_stack_below(ec, below_ec);
+   e_comp_wl_subsurface_stack_update(below_ec);
    if (e_config->transient.iconify)
      {
         E_Client *child;
@@ -491,6 +492,7 @@ e_policy_stack_above(E_Client *ec, E_Client *above_ec)
    EINA_SAFETY_ON_NULL_RETURN(above_ec->frame);
 
    e_client_stack_above(ec, above_ec);
+   e_comp_wl_subsurface_stack_update(above_ec);
    if (e_config->transient.iconify)
      {
         E_Client *child;