/* 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 =