Skip to content

compositor: introduce wlr_surface_set_role_object()

Kirill Primak requested to merge vyivel/wlroots:separate-role-object into master

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 take role_data now, which must be set separately with the new wlr_surface_set_role_object() function instead. A role object can only be set once and can't be changed until wlr_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

Merge request reports