diff --git a/src/main.c b/src/main.c index 29275cda0..468e58849 100644 --- a/src/main.c +++ b/src/main.c @@ -585,6 +585,9 @@ main (int argc, char **argv) ecode = EXIT_FAILURE; } + g_message ("Shutting down GNOME Shell"); + _shell_global_notify_shutdown (shell_global_get ()); + meta_context_destroy (g_steal_pointer (&context)); shell_profiler_shutdown (); diff --git a/src/shell-global-private.h b/src/shell-global-private.h index 9969691cb..a0834af8e 100644 --- a/src/shell-global-private.h +++ b/src/shell-global-private.h @@ -20,4 +20,6 @@ gboolean _shell_global_check_xdnd_event (ShellGlobal *global, void _shell_global_locate_pointer (ShellGlobal *global); +void _shell_global_notify_shutdown (ShellGlobal *global); + #endif /* __SHELL_GLOBAL_PRIVATE_H__ */ diff --git a/src/shell-global.c b/src/shell-global.c index ab8000e23..365e387f0 100644 --- a/src/shell-global.c +++ b/src/shell-global.c @@ -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); +}