diff options
author | Kirill Primak <vyivel@eclair.cafe> | 2023-06-22 15:05:34 +0300 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2023-06-23 11:54:05 +0000 |
commit | 0f67580aab115e9667650d52104e3ea3a5dfe20b (patch) | |
tree | 4c962155440d3ee0f6713a9d373012e4f367ab26 /include | |
parent | 0040c78c0befb4fef1f092924b0e9d2e6a07d542 (diff) |
compositor: introduce wlr_surface_set_role_object()
Diffstat (limited to 'include')
-rw-r--r-- | include/wlr/types/wlr_compositor.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/include/wlr/types/wlr_compositor.h b/include/wlr/types/wlr_compositor.h index 6a8bebdd..c8b63a59 100644 --- a/include/wlr/types/wlr_compositor.h +++ b/include/wlr/types/wlr_compositor.h @@ -230,18 +230,23 @@ typedef void (*wlr_surface_iterator_func_t)(struct wlr_surface *surface, int sx, int sy, void *data); /** - * Set the lifetime role for this surface. Returns true on success or false if - * the role cannot be set. + * Set the lifetime role for this surface. * - * If the role is represented by an object, role_data must be non-NULL. - * Alternatively, if the role isn't represented by any object, role_data must - * be NULL. + * If the surface already has a different role and/or has a role object set, + * the function fails and sends an error to the client. + * + * Returns true on success, false otherwise. */ -bool wlr_surface_set_role(struct wlr_surface *surface, - const struct wlr_surface_role *role, void *role_data, +bool wlr_surface_set_role(struct wlr_surface *surface, const struct wlr_surface_role *role, struct wl_resource *error_resource, uint32_t error_code); /** + * Set the role object for this surface. The surface must have a role and + * no already set role object. + */ +void wlr_surface_set_role_object(struct wlr_surface *surface, void *role_data); + +/** * Destroy the object representing the surface's role. If it doesn't exist, * this function is no-op. * |