diff options
author | Daniel Stone <daniels@collabora.com> | 2022-07-21 15:57:21 +0100 |
---|---|---|
committer | Pekka Paalanen <pq@iki.fi> | 2023-04-19 08:28:21 +0000 |
commit | 97421545b4313c875f81736f92bad7d7df6a85e6 (patch) | |
tree | 733e8e35ad263cd36724c7502e6b30e5ebc6b6ed | |
parent | 961be270b01886bcb58ce5a85a64b77535379456 (diff) | |
download | weston-97421545b4313c875f81736f92bad7d7df6a85e6.tar.gz |
screenshooter: Use wl_client, not wet_process
See discussion in wayland/weston!951 for the reasoning why: the
screenshooter must only deal with wl_client.
Signed-off-by: Daniel Stone <daniels@collabora.com>
-rw-r--r-- | compositor/weston-screenshooter.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/compositor/weston-screenshooter.c b/compositor/weston-screenshooter.c index cc531496..6c401249 100644 --- a/compositor/weston-screenshooter.c +++ b/compositor/weston-screenshooter.c @@ -36,17 +36,18 @@ struct screenshooter { struct weston_compositor *ec; struct wl_client *client; - struct weston_process process; + struct wl_listener client_destroy_listener; struct wl_listener compositor_destroy_listener; struct weston_recorder *recorder; struct wl_listener authorization; }; static void -screenshooter_sigchld(struct weston_process *process, int status) +screenshooter_client_destroy(struct wl_listener *listener, void *data) { struct screenshooter *shooter = - container_of(process, struct screenshooter, process); + container_of(listener, struct screenshooter, + client_destroy_listener); shooter->client = NULL; } @@ -68,11 +69,16 @@ screenshooter_binding(struct weston_keyboard *keyboard, return; } - if (!shooter->client) - shooter->client = weston_client_launch(shooter->ec, - &shooter->process, - screenshooter_exe, screenshooter_sigchld); + shooter->client = weston_client_start(shooter->ec, + screenshooter_exe); free(screenshooter_exe); + + if (!shooter->client) + return; + + shooter->client_destroy_listener.notify = screenshooter_client_destroy; + wl_client_add_destroy_listener(shooter->client, + &shooter->client_destroy_listener); } static void |