aboutsummaryrefslogtreecommitdiff
path: root/render.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-07-31 16:18:48 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-07-31 16:18:48 +0000
commit384b1c330ffbee4318ee75c97186450f0f6e9e35 (patch)
tree95ec962afd0ca2d25f5c3e0bf81dea2b190b9e40 /render.c
parentMerge branch 'tilde-expansion-in-include' (diff)
term: asynchronous client application termination
When the foot window is closed, and we need to terminate the client application, do this in an asynchronous fashion: * Don’t do a blocking call to waitpid(), instead, rely on the reaper callback * Use a timer FD to implement the timeout before sending SIGKILL (instead of using SIGALRM). * Send SIGTERM immediately (we used to *just* close the PTY, and then wait 2 seconds before sending SIGTERM). * Raise the timeout from 2 seconds to 60 Full shutdown now depends on *two* asynchronous tasks - unmapping the window, and waiting for the client application to terminate. Only when *both* of these have completed do we proceed and call term_destroy(), and the user provided shutdown callback.
Diffstat (limited to 'render.c')
-rw-r--r--render.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/render.c b/render.c
index 84796aa0..3fbbb579 100644
--- a/render.c
+++ b/render.c
@@ -3640,7 +3640,7 @@ fdm_hook_refresh_pending_terminals(struct fdm *fdm, void *data)
tll_foreach(renderer->wayl->terms, it) {
struct terminal *term = it->item;
- if (unlikely(!term->window->is_configured))
+ if (unlikely(term->is_shutting_down || !term->window->is_configured))
continue;
bool grid = term->render.refresh.grid;