subcompositor: convert to try_from

References: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/884
This commit is contained in:
Simon Ser 2023-02-01 20:14:39 +01:00
parent c5f7f8ab98
commit eb3e8f08a8
3 changed files with 22 additions and 40 deletions

View file

@ -62,18 +62,13 @@ struct wlr_subcompositor {
} events;
};
/**
* Returns true if the surface has the subsurface role.
*/
bool wlr_surface_is_subsurface(struct wlr_surface *surface);
/**
* Get a struct wlr_subsurface from a struct wlr_surface.
* Asserts that the surface has the subsurface role.
* May return NULL even if the surface has the subsurface role if the
* corresponding subsurface has been destroyed.
*
* Returns NULL if the surface doesn't have the subsurface role or if
* the subsurface has been destroyed.
*/
struct wlr_subsurface *wlr_subsurface_from_wlr_surface(
struct wlr_subsurface *wlr_subsurface_try_from_wlr_surface(
struct wlr_surface *surface);
struct wlr_subcompositor *wlr_subcompositor_create(struct wl_display *display);