compositor: introduce wlr_surface_set_role_object()
This allows to set the role without setting a role object.
Tested:
-
Trying to assign a different role fails and sends an error -
Trying to assign a role for a surface with an existing role object fails and sends an error -
Causing a role object initialization error after setting the role fails correctly and doesn't call the destroy hook on uninitialized memory
Breaking changes
-
wlr_surface_set_role()
doesn't takerole_data
now, which must be set separately with the newwlr_surface_set_role_object()
function instead. A role object can only be set once and can't be changed untilwlr_surface_destroy_role_object()
is called. If a role is represented by an object but the surface has no role object set, the role commit and unmap hooks aren't called.
Supersedes !4207 (closed)
Edited by Kirill Primak