compositor: replace role_data with role_resource

This increases type safety, makes it more obvious that role_data
must represent the role object, and will allow for automatic
cleanup when the resource is destroyed.
This commit is contained in:
Simon Ser 2023-06-23 14:23:27 +02:00
parent 00f1870d35
commit 89cb484220
10 changed files with 43 additions and 38 deletions

View file

@ -167,7 +167,7 @@ struct wlr_surface {
* The role object representing the role. NULL if the role isn't
* represented by any object or the object was destroyed.
*/
void *role_data;
struct wl_resource *role_resource;
struct {
struct wl_signal client_commit;
@ -247,7 +247,7 @@ bool wlr_surface_set_role(struct wlr_surface *surface, const struct wlr_surface_
* 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);
void wlr_surface_set_role_object(struct wlr_surface *surface, struct wl_resource *role_resource);
/**
* Destroy the object representing the surface's role. If it doesn't exist,