From 16b8c2e915fb7972ad5190ae2591b2d71789f477 Mon Sep 17 00:00:00 2001 From: Mikkel Oscar Lyderik Date: Tue, 29 Dec 2015 13:00:35 +0100 Subject: Handle SIGTERM sent to sway This makes sway handle and gracefully shut down everything when receiving a SIGTERM. Fix #416 --- sway/container.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sway/container.c') diff --git a/sway/container.c b/sway/container.c index e6fa4f37..dcf4dcc8 100644 --- a/sway/container.c +++ b/sway/container.c @@ -796,3 +796,13 @@ void add_gaps(swayc_t *view, void *_data) { } } } + +static void close_view(swayc_t *container, void *data) { + if (container->type == C_VIEW) { + wlc_view_close(container->handle); + } +} + +void close_views(swayc_t *container) { + container_map(container, close_view, NULL); +} -- cgit v1.2.3