diff --git a/ChangeLog b/ChangeLog index 4ba9e25e6..8038c0d7d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2002-06-08 Havoc Pennington + + * src/main.c (main): call meta_session_shutdown when exiting + cleanly + + * src/session.c (meta_session_shutdown): function to change use to + RestartIfRunning + (meta_session_init): change normal restart hint to + RestartImmediately + 2002-06-08 Havoc Pennington Yeah I know maximization is broken, I'm too tired to fix it. diff --git a/src/main.c b/src/main.c index 9b6532e56..d5009e2af 100644 --- a/src/main.c +++ b/src/main.c @@ -317,6 +317,8 @@ main (int argc, char **argv) g_slist_free (displays); } + meta_session_shutdown (); + if (meta_restart_after_quit) { GError *err; diff --git a/src/session.c b/src/session.c index ed8570200..3f9981b24 100644 --- a/src/session.c +++ b/src/session.c @@ -34,6 +34,12 @@ meta_session_init (const char *client_id, meta_topic (META_DEBUG_SM, "Compiled without session management support\n"); } +void +meta_session_shutdown (void) +{ + /* nothing */ +} + const MetaWindowSessionInfo* meta_window_lookup_saved_state (MetaWindow *window) { @@ -284,7 +290,7 @@ meta_session_init (const char *previous_client_id, SmProp prop1, prop2, prop3, prop4, prop5, prop6, *props[6]; SmPropValue prop1val, prop2val, prop3val, prop4val, prop5val, prop6val; char pid[32]; - char hint = SmRestartIfRunning; + char hint = SmRestartImmediately; char priority = 20; /* low to run before other apps */ prop1.name = SmProgram; @@ -348,6 +354,31 @@ meta_session_init (const char *previous_client_id, g_free (saved_client_id); } +void +meta_session_shutdown (void) +{ + /* Change our restart mode to IfRunning */ + + SmProp prop1; + SmPropValue prop1val; + SmProp *props[1]; + char hint = SmRestartIfRunning; + + if (session_connection == NULL) + return; + + prop1.name = SmRestartStyleHint; + prop1.type = SmCARD8; + prop1.num_vals = 1; + prop1.vals = &prop1val; + prop1val.value = &hint; + prop1val.length = 1; + + props[0] = &prop1; + + SmcSetProperties (session_connection, 1, props); +} + static void disconnect (void) { diff --git a/src/session.h b/src/session.h index cf02915cd..93c9df558 100644 --- a/src/session.h +++ b/src/session.h @@ -64,6 +64,8 @@ void meta_session_init (const char *client_id, const char *save_file); +void meta_session_shutdown (void); + #endif