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>
This commit is contained in:
Philip Withnall 2024-06-28 17:10:16 +01:00
parent 1369eba03a
commit 3d5beec553
No known key found for this signature in database
GPG key ID: DCDF5885B1F3ED73

View file

@ -589,6 +589,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);
}