From 0f0154fed4ffb39e7e9d15d739b63b51c3d114e7 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Sun, 7 Jul 2024 22:15:50 +0200 Subject: [PATCH] ext-image-copy-capture-v1: implement PAINT_CURSORS flag This is unreliable because this is first come, first served: the first capture stream decides whether or not cursors will be included. Moreover, if the output lacks hw cursor support, cursors will always be included. But it's the best we're going to get with automatic wlr_output sources (and has bug parity with wlr-screencopy-unstable-v1). --- types/wlr_ext_image_copy_capture_v1.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/types/wlr_ext_image_copy_capture_v1.c b/types/wlr_ext_image_copy_capture_v1.c index 6dc8ca9b..321c6f99 100644 --- a/types/wlr_ext_image_copy_capture_v1.c +++ b/types/wlr_ext_image_copy_capture_v1.c @@ -385,6 +385,10 @@ static void session_destroy(struct wlr_ext_image_copy_capture_session_v1 *sessio EXT_IMAGE_COPY_CAPTURE_FRAME_V1_FAILURE_REASON_STOPPED); } + if (session->source->impl->stop) { + session->source->impl->stop(session->source); + } + ext_image_copy_capture_session_v1_send_stopped(session->resource); wl_resource_set_user_data(session->resource, NULL); @@ -455,6 +459,10 @@ static void session_create(struct wl_resource *parent_resource, uint32_t new_id, return; } + if (source->impl->start) { + source->impl->start(source, options & EXT_IMAGE_COPY_CAPTURE_MANAGER_V1_OPTIONS_PAINT_CURSORS); + } + session->resource = session_resource; session->source = source; pixman_region32_init_rect(&session->damage, 0, 0, source->width,