Document NULL return value of foo_from_wlr_surface() functions

wlr_xdg_surface_from_wlr_surface() for example may return NULL even if
the surface has the xdg surface role if the corresponding xdg surface
has been destroyed.
This commit is contained in:
Isaac Freund 2022-07-01 20:37:34 +02:00
parent 694b8c6683
commit ffb53a6103
No known key found for this signature in database
GPG key ID: 86DED400DDFD7A11
6 changed files with 55 additions and 2 deletions

View file

@ -273,8 +273,17 @@ void wlr_xwayland_surface_set_fullscreen(struct wlr_xwayland_surface *surface,
void wlr_xwayland_set_seat(struct wlr_xwayland *xwayland,
struct wlr_seat *seat);
/**
* Returns true if the surface has the xwayland surface role.
*/
bool wlr_surface_is_xwayland_surface(struct wlr_surface *surface);
/**
* Get a struct wlr_xwayland_surface from a struct wlr_surface.
* Asserts that the surface has the xwayland surface role.
* May return NULL even if the surface has the xwayland surface role if the
* corresponding xwayland surface has been destroyed.
*/
struct wlr_xwayland_surface *wlr_xwayland_surface_from_wlr_surface(
struct wlr_surface *surface);