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 <pwithnall@gnome.org>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3397>
This commit is contained in:
Philip Withnall 2024-06-28 17:10:16 +01:00 committed by Marge Bot
parent 212e098da1
commit debf00c893

View File

@ -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);
}