main: Notify about shutdown before tearing down

This will allow the shell to tear things down more gracefully.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1349>
This commit is contained in:
Jonas Ådahl
2022-08-17 16:27:09 +02:00
parent 009da0df64
commit f6a5093c09
3 changed files with 19 additions and 0 deletions

View File

@ -120,6 +120,7 @@ enum
{
NOTIFY_ERROR,
LOCATE_POINTER,
SHUTDOWN,
LAST_SIGNAL
};
@ -507,6 +508,13 @@ shell_global_class_init (ShellGlobalClass *klass)
0,
NULL, NULL, NULL,
G_TYPE_NONE, 0);
shell_global_signals[SHUTDOWN] =
g_signal_new ("shutdown",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL, NULL,
G_TYPE_NONE, 0);
props[PROP_SESSION_MODE] =
g_param_spec_string ("session-mode",
@ -1872,3 +1880,9 @@ _shell_global_locate_pointer (ShellGlobal *global)
{
g_signal_emit (global, shell_global_signals[LOCATE_POINTER], 0);
}
void
_shell_global_notify_shutdown (ShellGlobal *global)
{
g_signal_emit (global, shell_global_signals[SHUTDOWN], 0);
}