summaryrefslogtreecommitdiff
path: root/gnome-session/manager.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@cygnus.com>1998-06-09 05:04:06 +0000
committerTom Tromey <tromey@src.gnome.org>1998-06-09 05:04:06 +0000
commit79138e884a1720b993e797168995d3660e59f4d1 (patch)
tree3b1e739a02ac0dbdfa8c6be98e7d712962139d1f /gnome-session/manager.c
parent844f4b3b812877f398cdf4af9194985fb55d736d (diff)
downloadgnome-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.c26
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 ();
}
}