From debf00c893ab4150dffd2ba1a40f4f6c51944542 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Fri, 28 Jun 2024 17:10:16 +0100 Subject: [PATCH] main: Gracefully shut down on SIGINT as well as SIGTERM This is mostly for use when testing a nested gnome-shell in a terminal: terminating it with Ctrl+C from that terminal should give the process an opportunity to save state on shutdown (such as the screen time limits history file). Signed-off-by: Philip Withnall Part-of: --- src/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.c b/src/main.c index b4733cc6f..af4fa8597 100644 --- a/src/main.c +++ b/src/main.c @@ -572,6 +572,7 @@ init_signal_handlers (MetaContext *context) g_warning ("Failed to register SIGXFSZ handler: %s", g_strerror (errno)); #endif + g_unix_signal_add (SIGINT, on_sigterm, context); g_unix_signal_add (SIGTERM, on_sigterm, context); }