From 0052078bd3c65c083f0768a9a02b55be77b9fd6c Mon Sep 17 00:00:00 2001 From: Kirill Primak Date: Sat, 27 Jan 2024 11:28:37 +0300 Subject: compositor: introduce wlr_surface_reject_pending() --- include/wlr/types/wlr_compositor.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include/wlr') diff --git a/include/wlr/types/wlr_compositor.h b/include/wlr/types/wlr_compositor.h index da12427e..2005a949 100644 --- a/include/wlr/types/wlr_compositor.h +++ b/include/wlr/types/wlr_compositor.h @@ -231,6 +231,9 @@ struct wlr_surface { bool opaque; + bool handling_commit; + bool pending_rejected; + int32_t preferred_buffer_scale; bool preferred_buffer_transform_sent; enum wl_output_transform preferred_buffer_transform; @@ -290,6 +293,15 @@ void wlr_surface_map(struct wlr_surface *surface); */ void wlr_surface_unmap(struct wlr_surface *surface); +/** + * Mark the pending state of a surface as rejected due to a protocol violation, + * preventing it from being cached or committed. + * + * This function must only be used while processing a commit request. + */ +void wlr_surface_reject_pending(struct wlr_surface *surface, struct wl_resource *resource, + uint32_t code, const char *msg, ...); + /** * Whether or not this surface currently has an attached buffer. A surface has * an attached buffer when it commits with a non-null buffer in its pending -- cgit v1.2.3