From 2681352e0422221c047b79dfa5c19425cf59d403 Mon Sep 17 00:00:00 2001 From: emersion Date: Mon, 28 May 2018 08:20:01 +0100 Subject: [PATCH] export-dmabuf: permanently fail if backend doesn't implement export_dmabuf --- types/wlr_export_dmabuf_v1.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/types/wlr_export_dmabuf_v1.c b/types/wlr_export_dmabuf_v1.c index a2faf2ff..a86fe78c 100644 --- a/types/wlr_export_dmabuf_v1.c +++ b/types/wlr_export_dmabuf_v1.c @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -90,6 +91,12 @@ static void manager_handle_capture_output(struct wl_client *client, wl_list_insert(&manager->frames, &frame->link); + if (!output->impl->export_dmabuf) { + zwlr_export_dmabuf_frame_v1_send_cancel(frame->resource, + ZWLR_EXPORT_DMABUF_FRAME_V1_CANCEL_REASON_PERNAMENT); + return; + } + struct wlr_dmabuf_buffer_attribs *attribs = &frame->attribs; if (!wlr_output_export_dmabuf(output, attribs)) { zwlr_export_dmabuf_frame_v1_send_cancel(frame->resource,