call meta_session_shutdown when exiting cleanly

2002-06-08  Havoc Pennington  <hp@pobox.com>

	* 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
This commit is contained in:
Havoc Pennington 2002-06-08 22:04:59 +00:00 committed by Havoc Pennington
parent e694f07144
commit be44a1d9a5
4 changed files with 46 additions and 1 deletions

View File

@ -1,3 +1,13 @@
2002-06-08 Havoc Pennington <hp@pobox.com>
* 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 <hp@pobox.com> 2002-06-08 Havoc Pennington <hp@pobox.com>
Yeah I know maximization is broken, I'm too tired to fix it. Yeah I know maximization is broken, I'm too tired to fix it.

View File

@ -317,6 +317,8 @@ main (int argc, char **argv)
g_slist_free (displays); g_slist_free (displays);
} }
meta_session_shutdown ();
if (meta_restart_after_quit) if (meta_restart_after_quit)
{ {
GError *err; GError *err;

View File

@ -34,6 +34,12 @@ meta_session_init (const char *client_id,
meta_topic (META_DEBUG_SM, "Compiled without session management support\n"); meta_topic (META_DEBUG_SM, "Compiled without session management support\n");
} }
void
meta_session_shutdown (void)
{
/* nothing */
}
const MetaWindowSessionInfo* const MetaWindowSessionInfo*
meta_window_lookup_saved_state (MetaWindow *window) 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]; SmProp prop1, prop2, prop3, prop4, prop5, prop6, *props[6];
SmPropValue prop1val, prop2val, prop3val, prop4val, prop5val, prop6val; SmPropValue prop1val, prop2val, prop3val, prop4val, prop5val, prop6val;
char pid[32]; char pid[32];
char hint = SmRestartIfRunning; char hint = SmRestartImmediately;
char priority = 20; /* low to run before other apps */ char priority = 20; /* low to run before other apps */
prop1.name = SmProgram; prop1.name = SmProgram;
@ -348,6 +354,31 @@ meta_session_init (const char *previous_client_id,
g_free (saved_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 static void
disconnect (void) disconnect (void)
{ {

View File

@ -64,6 +64,8 @@ void meta_session_init (const char *client_id,
const char *save_file); const char *save_file);
void meta_session_shutdown (void);
#endif #endif