From: Doyoun Kang Date: Wed, 4 Nov 2020 11:56:08 +0000 (+0900) Subject: Revert "subsurface: Do not raise a protocol error for a reference surface as parent." X-Git-Tag: submit/tizen/20201105.050753~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F51%2F246851%2F1;p=platform%2Fupstream%2Fenlightenment.git Revert "subsurface: Do not raise a protocol error for a reference surface as parent." This reverts commit 29359d02eb4667384e599ba6baa0797d14f823ca. Change-Id: I3321d170c72a97c8b80e7e1b6e794dafe5cbb01a --- diff --git a/src/bin/e_comp_wl_subsurface.c b/src/bin/e_comp_wl_subsurface.c index e8ce3f54a4..3c4b05d986 100644 --- a/src/bin/e_comp_wl_subsurface.c +++ b/src/bin/e_comp_wl_subsurface.c @@ -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);