screencopy: send failed when copying a DMA-BUF with a region

We don't support that yet.
This commit is contained in:
Simon Ser 2020-11-04 16:06:45 +01:00
parent 51fc7ddb29
commit 4471a83ed0
1 changed files with 9 additions and 0 deletions

View File

@ -278,6 +278,15 @@ static void frame_handle_output_commit(struct wl_listener *listener,
wl_list_remove(&frame->output_commit.link); wl_list_remove(&frame->output_commit.link);
wl_list_init(&frame->output_commit.link); wl_list_init(&frame->output_commit.link);
// TODO: add support for copying regions with DMA-BUFs
if (frame->box.x != 0 || frame->box.y != 0 ||
output->width != frame->box.width ||
output->height != frame->box.height) {
zwlr_screencopy_frame_v1_send_failed(frame->resource);
frame_destroy(frame);
return;
}
struct wlr_dmabuf_attributes attr = { 0 }; struct wlr_dmabuf_attributes attr = { 0 };
bool ok = wlr_output_export_dmabuf(output, &attr); bool ok = wlr_output_export_dmabuf(output, &attr);
ok = ok && wlr_renderer_blit_dmabuf(renderer, ok = ok && wlr_renderer_blit_dmabuf(renderer,