1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
/*
* panel-session.c: panel session management routines
*
* Copyright (C) 2003 Sun Microsystems, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301, USA.
*
* Authors:
* Mark McLoughlin <mark@skynet.ie>
*/
#include <config.h>
#include <stdlib.h>
#include <libegg/eggsmclient.h>
#ifdef HAVE_X11
#include "xstuff.h"
#endif
#include "panel-shell.h"
#include "panel-session.h"
static gboolean do_not_restart = FALSE;
static void
panel_session_handle_quit (EggSMClient *client,
gpointer data)
{
panel_shell_quit ();
}
void
panel_session_do_not_restart (void)
{
do_not_restart = TRUE;
if (egg_sm_client_get_mode () != EGG_SM_CLIENT_MODE_DISABLED)
egg_sm_client_set_mode (EGG_SM_CLIENT_MODE_NO_RESTART);
}
void
panel_session_init (void)
{
EggSMClientMode mode;
EggSMClient *client;
/* Explicitly tell the session manager we're ready -- we don't do it
* before. Note: this depends on setting the mode to DISABLED early
* during startup. */
if (do_not_restart || getenv ("MATE_PANEL_DEBUG"))
mode = EGG_SM_CLIENT_MODE_NO_RESTART;
else
mode = EGG_SM_CLIENT_MODE_NORMAL;
egg_sm_client_set_mode (mode);
client = egg_sm_client_get ();
g_signal_connect (client, "quit",
G_CALLBACK (panel_session_handle_quit), NULL);
#ifdef HAVE_X11
if (is_using_x11 ()) {
/* We don't want the X WM to try and save/restore our
* window position */
gdk_x11_set_sm_client_id (NULL);
}
#endif
}
|