set toplevel role on wlr_surface

This commit is contained in:
Tony Crisci 2017-09-11 18:06:19 -04:00
parent c5f8f81e58
commit b2c71287f2
4 changed files with 51 additions and 0 deletions

View file

@ -70,4 +70,12 @@ void wlr_surface_get_matrix(struct wlr_surface *surface,
const float (*projection)[16],
const float (*transform)[16]);
/**
* Set the lifetime role for this surface. Returns 0 on success or -1 if the
* role cannot be set.
*/
int wlr_surface_set_role(struct wlr_surface *surface, const char *role,
struct wl_resource *error_resource, uint32_t error_code);
#endif

View file

@ -10,10 +10,17 @@ struct wlr_xdg_shell_v6 {
void *data;
};
enum wlr_xdg_surface_v6_role {
WLR_XDG_SURFACE_V6_ROLE_NONE,
WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL,
WLR_XDG_SURFACE_V6_ROLE_POPUP,
};
struct wlr_xdg_surface_v6 {
struct wl_resource *resource;
struct wl_resource *surface;
struct wl_list link;
enum wlr_xdg_surface_v6_role role;
struct wl_listener surface_destroy_listener;