Revert "subsurface: Do not raise a protocol error for a reference surface as parent." 51/246851/1
authorDoyoun Kang <doyoun.kang@samsung.com>
Wed, 4 Nov 2020 11:56:08 +0000 (20:56 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Wed, 4 Nov 2020 11:56:13 +0000 (20:56 +0900)
This reverts commit 29359d02eb4667384e599ba6baa0797d14f823ca.

Change-Id: I3321d170c72a97c8b80e7e1b6e794dafe5cbb01a

src/bin/e_comp_wl_subsurface.c

index e8ce3f5..3c4b05d 100644 (file)
@@ -550,9 +550,6 @@ _subsurface_sibling_check(E_Client *ec1, E_Client *ec2)
 
    parent = ec1->comp_data->sub.data->parent;
 
-   if (parent == ec2)
-     return EINA_TRUE;
-
    EINA_LIST_FOREACH(parent->comp_data->sub.list_pending, l, sibling)
      {
         if ((sibling != ec1) && (sibling == ec2))
@@ -581,12 +578,14 @@ _e_comp_wl_subsurface_cb_place_above(struct wl_client *client EINA_UNUSED, struc
    if (e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) return;
    if (!ec->comp_data->sub.data) return;
 
-   if (!(parent = ec->comp_data->sub.data->parent)) return;
-   if (e_object_is_del(E_OBJECT(parent)) || !parent->comp_data) return;
-
    /* try to get the client from the sibling resource */
    if (!(ecs = wl_resource_get_user_data(sibling_resource))) return;
 
+   if (!ecs->comp_data->sub.data) return;
+
+   if (!(parent = ec->comp_data->sub.data->parent)) return;
+   if (e_object_is_del(E_OBJECT(parent)) || !parent->comp_data) return;
+
    if (!_subsurface_sibling_check(ec, ecs))
      {
         wl_resource_post_error(ec->comp_data->sub.data->resource,
@@ -596,8 +595,6 @@ _e_comp_wl_subsurface_cb_place_above(struct wl_client *client EINA_UNUSED, struc
         return;
      }
 
-   if (!ecs->comp_data->sub.data) return;
-
    parent->comp_data->sub.list_pending =
      eina_list_remove(parent->comp_data->sub.list_pending, ec);
 
@@ -620,12 +617,14 @@ _e_comp_wl_subsurface_cb_place_below(struct wl_client *client EINA_UNUSED, struc
    if (e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) return;
    if (!ec->comp_data->sub.data) return;
 
-   if (!(parent = ec->comp_data->sub.data->parent)) return;
-   if (e_object_is_del(E_OBJECT(parent)) || !parent->comp_data) return;
-
    /* try to get the client from the sibling resource */
    if (!(ecs = wl_resource_get_user_data(sibling_resource))) return;
 
+   if (!ecs->comp_data->sub.data) return;
+
+   if (!(parent = ec->comp_data->sub.data->parent)) return;
+   if (e_object_is_del(E_OBJECT(parent)) || !parent->comp_data) return;
+
    if (!_subsurface_sibling_check(ec, ecs))
      {
         wl_resource_post_error(ec->comp_data->sub.data->resource,
@@ -635,8 +634,6 @@ _e_comp_wl_subsurface_cb_place_below(struct wl_client *client EINA_UNUSED, struc
         return;
      }
 
-   if (!ecs->comp_data->sub.data) return;
-
    parent->comp_data->sub.list_pending =
      eina_list_remove(parent->comp_data->sub.list_pending, ec);