aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-11-04 16:06:45 +0100
committerSimon Ser <contact@emersion.fr>2020-11-05 09:43:42 +0100
commit4471a83ed0ce3c717d6d59c0a99fbc63614cb248 (patch)
treeb51822c942015ebda95fef750c444aeddf1c4587
parent51fc7ddb294895ccfad173afc8f3a920f6aede4a (diff)
screencopy: send failed when copying a DMA-BUF with a region
We don't support that yet.
-rw-r--r--types/wlr_screencopy_v1.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/types/wlr_screencopy_v1.c b/types/wlr_screencopy_v1.c
index d1e8336e..2d81ff7b 100644
--- a/types/wlr_screencopy_v1.c
+++ b/types/wlr_screencopy_v1.c
@@ -278,6 +278,15 @@ static void frame_handle_output_commit(struct wl_listener *listener,
wl_list_remove(&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 };
bool ok = wlr_output_export_dmabuf(output, &attr);
ok = ok && wlr_renderer_blit_dmabuf(renderer,