From: Seunghun Lee Date: Tue, 22 Sep 2020 04:52:01 +0000 (+0900) Subject: subsurface: Raise a protocol error for a bad parent. X-Git-Tag: submit/tizen/20201109.083635~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ba6c6b0121c9bbcbfcc2187a947dab8b3dc95d2f;p=platform%2Fupstream%2Fenlightenment.git subsurface: Raise a protocol error for a bad parent. This case should be failed noisily. Change-Id: If20eadc7bab66696fe01f323b03bb3a7f9d7819e --- diff --git a/src/bin/e_comp_wl_subsurface.c b/src/bin/e_comp_wl_subsurface.c index e8ce3f54a4..ab85fd25b2 100644 --- a/src/bin/e_comp_wl_subsurface.c +++ b/src/bin/e_comp_wl_subsurface.c @@ -736,8 +736,18 @@ _e_comp_wl_subcompositor_cb_subsurface_get(struct wl_client *client EINA_UNUSED, /* try to create a new subsurface */ if (!e_comp_wl_subsurface_create(ec, epc, id, surface_resource)) - ERR("Failed to create subsurface for surface %d", - wl_resource_get_id(surface_resource)); + { + if (_e_comp_wl_subsurface_circular_reference_check(ec, epc)) + { + wl_resource_post_error(resource, + WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE, + "%s%d: wl_surface@%d is an ancestor of parent", + where, id, wl_resource_get_id(surface_resource)); + } + + ERR("Failed to create subsurface for surface %d", + wl_resource_get_id(surface_resource)); + } } static const struct wl_subcompositor_interface _e_subcomp_interface =