From d3cbe02df50c847973c1ba147e0a112838af26c5 Mon Sep 17 00:00:00 2001 From: Seunghun Lee Date: Tue, 22 Sep 2020 13:52:01 +0900 Subject: [PATCH] subsurface: Raise a protocol error for a bad parent. This case should be failed noisily. Change-Id: Id9567bdbaefa8c28378d4a7c67d895b91c7b0d5d --- src/bin/e_comp_wl_subsurface.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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 = -- 2.34.1