Gracefully handle inert wl_output resources

Closes: https://github.com/swaywm/wlroots/issues/2088
This commit is contained in:
Simon Ser 2020-03-28 20:56:27 +01:00 committed by Drew DeVault
parent 13db99b0f8
commit 7516a98167
4 changed files with 35 additions and 11 deletions

View file

@ -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