summaryrefslogtreecommitdiff
path: root/src/session.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2002-06-08 22:04:59 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-06-08 22:04:59 +0000
commitbe44a1d9a5f78a16a236aabb7cabc9db8bdc31a3 (patch)
treea6b31c6b7f9207f1e743acde55b055db007126f9 /src/session.c
parente694f071443fb80255d80103f7d50f14fb4f0a93 (diff)
downloadmetacity-be44a1d9a5f78a16a236aabb7cabc9db8bdc31a3.tar.gz
metacity-be44a1d9a5f78a16a236aabb7cabc9db8bdc31a3.tar.bz2
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
Diffstat (limited to 'src/session.c')
-rw-r--r--src/session.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/session.c b/src/session.c
index ed85702..3f9981b 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)
{