export-dmabuf: Keep frame->output = NULL until frame is ready

This fixes a crash that happens when a client requests a frame on a
backend that does not implement export_dmabuf.

An assertion fails with the message:
sway: types/wlr_output.c:777: wlr_output_lock_attach_render: Assertion
`output->attach_render_locks > 0' failed.
This commit is contained in:
Andri Yngvason 2020-05-31 21:23:42 +00:00 committed by Simon Ser
parent 32148808ad
commit 034384f5aa

View file

@ -98,7 +98,6 @@ static void manager_handle_capture_output(struct wl_client *client,
return; return;
} }
frame->manager = manager; frame->manager = manager;
frame->output = output;
wl_list_init(&frame->output_precommit.link); wl_list_init(&frame->output_precommit.link);
uint32_t version = wl_resource_get_version(manager_resource); uint32_t version = wl_resource_get_version(manager_resource);
@ -129,6 +128,8 @@ static void manager_handle_capture_output(struct wl_client *client,
return; return;
} }
frame->output = output;
wlr_output_lock_attach_render(frame->output, true); wlr_output_lock_attach_render(frame->output, true);
if (overlay_cursor) { if (overlay_cursor) {
wlr_output_lock_software_cursors(frame->output, true); wlr_output_lock_software_cursors(frame->output, true);