aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-03-28 20:56:27 +0100
committerDrew DeVault <sir@cmpwn.com>2020-03-29 20:57:28 +0200
commit7516a98167326350fb6e1906224bbff04fbf4c62 (patch)
treeede663f71490d3424f12c1b76edb386dd012badf /include
parent13db99b0f829791ed3d794b73f9cdccd99c46939 (diff)
Gracefully handle inert wl_output resources
Closes: https://github.com/swaywm/wlroots/issues/2088
Diffstat (limited to 'include')
-rw-r--r--include/wlr/types/wlr_output.h5
1 files changed, 5 insertions, 0 deletions
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