25
25
#include <config.h>
27
#include <libgnomeui/gnome-client.h>
29
27
#include <stdlib.h>
31
#include <libegg/eggsmclient.h>
31
33
#include "panel-shell.h"
33
35
#include "panel-session.h"
37
static gboolean do_not_restart = FALSE;
36
panel_session_handle_die_request (GnomeClient *client)
40
panel_session_handle_quit (EggSMClient *client,
38
g_return_if_fail (GNOME_IS_CLIENT (client));
40
43
panel_shell_quit ();
44
47
panel_session_do_not_restart (void)
48
client = gnome_master_client ();
50
gnome_client_set_restart_style (client, GNOME_RESTART_IF_RUNNING);
49
do_not_restart = TRUE;
51
if (egg_sm_client_get_mode () != EGG_SM_CLIENT_MODE_DISABLED)
52
egg_sm_client_set_mode (EGG_SM_CLIENT_MODE_NO_RESTART);
54
56
panel_session_init (void)
58
client = gnome_master_client ();
60
61
/* Explicitly tell the session manager we're ready -- we don't do it
62
* TODO: when migrating away from libgnomeui, we need to keep this
63
* late connection. In its current state, I don't think eggsmclient
64
* supports this (because it connects to the session manager in a
65
* post-options-parsing hook). */
66
gnome_client_connect (client);
62
* before. Note: this depends on setting the mode to DISABLED early
65
if (do_not_restart || getenv ("GNOME_PANEL_DEBUG"))
66
mode = EGG_SM_CLIENT_MODE_NO_RESTART;
68
mode = EGG_SM_CLIENT_MODE_NORMAL;
70
egg_sm_client_set_mode (mode);
72
client = egg_sm_client_get ();
74
g_signal_connect (client, "quit",
75
G_CALLBACK (panel_session_handle_quit), NULL);
68
77
/* We don't want the WM to try and save/restore our
69
78
* window position */
70
79
gdk_set_sm_client_id (NULL);
72
if (!getenv ("GNOME_PANEL_DEBUG"))
73
gnome_client_set_restart_style (client, GNOME_RESTART_IMMEDIATELY);
75
gnome_client_set_priority (client, 40);
77
g_signal_connect (client, "die",
78
G_CALLBACK (panel_session_handle_die_request), NULL);