summaryrefslogtreecommitdiffstats
path: root/src/compositor.c
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2024-04-18 18:34:47 +0300
committerMarius Vlad <marius.vlad@collabora.com>2024-04-20 17:21:45 +0300
commit6366348eccec778f02061070d1334ea897d4f514 (patch)
tree7a2d7a0bff3c2aaa454a63e021559e012abee468 /src/compositor.c
parentd2510f1e79e501a8e6aecb8058746a7456d1367e (diff)
clients/screenshot: Add support for weston output capture
libweston now provides a protocol which we can use for doing screenshots, not needing to provide one ourselves. This imports a simple client used in Weston but it has some changes to match our current args. Bug-AGL: SPEC-5095 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I00c9e976975447c74668fbfe1045b9177c623064
Diffstat (limited to 'src/compositor.c')
-rw-r--r--src/compositor.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/compositor.c b/src/compositor.c
index 1881702..bdff9ed 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -104,6 +104,13 @@ ivi_init_parsed_options(struct weston_compositor *compositor)
}
static void
+screenshot_allow_all(struct wl_listener *l, struct weston_output_capture_attempt *att)
+{
+ att->authorized = true;
+}
+
+
+static void
sigint_helper(int sig)
{
raise(SIGUSR2);
@@ -2237,8 +2244,11 @@ int wet_main(int argc, char *argv[], const struct weston_testsuite_data *test_da
ivi_launch_shell_client(&ivi, "shell-client-ext",
&ivi.shell_client_ext.client);
- if (debug)
- ivi_screenshooter_create(&ivi);
+ if (debug) {
+ weston_compositor_add_screenshot_authority(ivi.compositor,
+ &ivi.screenshot_auth,
+ screenshot_allow_all);
+ }
ivi_agl_systemd_notify(&ivi);
wl_display_run(display);