diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c index 3d586eca..714881bd 100644 --- a/desktop-shell/shell.c +++ b/desktop-shell/shell.c @@ -5007,6 +5007,17 @@ desktop_shell_sigchld(struct weston_process *process, int status) shell_fade_startup(shell); } +static void +desktop_shell_client_destroy(struct wl_listener *listener, void *data) +{ + struct desktop_shell *shell; + + shell = container_of(listener, struct desktop_shell, + child.client_destroy_listener); + + shell->child.client = NULL; +} + static void launch_desktop_shell_process(void *data) { @@ -5019,6 +5030,11 @@ launch_desktop_shell_process(void *data) if (!shell->child.client) weston_log("not able to start %s\n", shell->client); + + shell->child.client_destroy_listener.notify = + desktop_shell_client_destroy; + wl_client_add_destroy_listener(shell->child.client, + &shell->child.client_destroy_listener); } static void diff --git a/desktop-shell/shell.h b/desktop-shell/shell.h index d7c34fc0..7a8194d1 100644 --- a/desktop-shell/shell.h +++ b/desktop-shell/shell.h @@ -92,6 +92,7 @@ struct desktop_shell { struct weston_process process; struct wl_client *client; struct wl_resource *desktop_shell; + struct wl_listener client_destroy_listener; unsigned deathcount; uint32_t deathstamp;