compositor: introduce wlr_surface_reject_pending()

This commit is contained in:
Kirill Primak 2024-01-27 11:28:37 +03:00 committed by Simon Ser
parent 5ae8ce807a
commit 0052078bd3
8 changed files with 59 additions and 21 deletions

View file

@ -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