diff options
author | Tom Tromey <tromey@cygnus.com> | 1998-06-09 05:04:06 +0000 |
---|---|---|
committer | Tom Tromey <tromey@src.gnome.org> | 1998-06-09 05:04:06 +0000 |
commit | 79138e884a1720b993e797168995d3660e59f4d1 (patch) | |
tree | 3b1e739a02ac0dbdfa8c6be98e7d712962139d1f /gnome-session/manager.c | |
parent | 844f4b3b812877f398cdf4af9194985fb55d736d (diff) | |
download | gnome-session-79138e884a1720b993e797168995d3660e59f4d1.tar.gz |
If no clients in saved session, load default session.
Sat Jun 6 02:09:49 1998 Tom Tromey <tromey@cygnus.com>
* save.c (read_session): If no clients in saved session, load
default session.
* manager.c (run_shutdown_commands): New function.
(check_session_end): Call it.
Diffstat (limited to 'gnome-session/manager.c')
-rw-r--r-- | gnome-session/manager.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gnome-session/manager.c b/gnome-session/manager.c index 202cab4b..3d976ebd 100644 --- a/gnome-session/manager.c +++ b/gnome-session/manager.c @@ -258,6 +258,24 @@ save_yourself_p2_request (SmsConn connection, SmPointer data) APPEND (save_yourself_p2_list, client); } +/* A helper function. Finds and executes each shutdown command. */ +static void +run_shutdown_commands (const GSList *list) +{ + for (; list; list = list->next) + { + Client *client = (Client *) list->data; + char **argv; + int argc; + + if (find_vector_property (client, SmShutdownCommand, &argc, &argv)) + { + gnome_execute_async (NULL, argc, argv); + free_vector (argc, argv); + } + } +} + /* This is a helper function which is run when it might be time to actually save the session. It is run when the save_yourself lists are modified. */ @@ -280,8 +298,16 @@ check_session_end (int found) save_finished_list = NULL; if (shutting_down) { + /* Run each shutdown command. The manual doesn't make + it clear whether this should be done for all clients + or only those that have RestartAnyway set. We run + them all. */ + run_shutdown_commands (anyway_list); + run_shutdown_commands (live_list); + /* Make sure that all client connections are closed. */ send_message (live_list, kill_client_connection); + gtk_main_quit (); } } |