From 7516a98167326350fb6e1906224bbff04fbf4c62 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Sat, 28 Mar 2020 20:56:27 +0100 Subject: Gracefully handle inert wl_output resources Closes: https://github.com/swaywm/wlroots/issues/2088 --- include/wlr/types/wlr_output.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h index 9d6e85b3..3b7f7ee3 100644 --- a/include/wlr/types/wlr_output.h +++ b/include/wlr/types/wlr_output.h @@ -369,6 +369,11 @@ bool wlr_output_set_gamma(struct wlr_output *output, size_t size, const uint16_t *r, const uint16_t *g, const uint16_t *b); bool wlr_output_export_dmabuf(struct wlr_output *output, struct wlr_dmabuf_attributes *attribs); +/** + * Returns the wlr_output matching the provided wl_output resource. If the + * resource isn't a wl_output, it aborts. If the resource is inert (because the + * wlr_output has been destroyed), NULL is returned. + */ struct wlr_output *wlr_output_from_resource(struct wl_resource *resource); /** * Locks the output to only use rendering instead of direct scan-out. This is -- cgit v1.2.3