1 Description: Add "RequestShutdown" and "RequestReboot" DBus methods to allow
2 other applications to shutdown or reboot the machine via the session manager
3 Author: Chris Coulson <chrisccoulson@ubuntu.com>
5 Index: gnome-session-2.32.1/gnome-session/gsm-manager.c
6 ===================================================================
7 --- gnome-session-2.32.1.orig/gnome-session/gsm-manager.c 2010-11-17 16:23:49.851939998 +0100
8 +++ gnome-session-2.32.1/gnome-session/gsm-manager.c 2010-11-17 16:23:50.203940000 +0100
13 +gsm_manager_request_shutdown (GsmManager *manager,
16 + g_debug ("GsmManager: RequestShutdown called");
18 + g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE);
20 + if (manager->priv->phase != GSM_MANAGER_PHASE_RUNNING) {
23 + GSM_MANAGER_ERROR_NOT_IN_RUNNING,
24 + "RequestShutdown interface is only available during the Running phase");
28 + request_shutdown (manager);
34 +gsm_manager_request_reboot (GsmManager *manager,
37 + g_debug ("GsmManager: RequestReboot called");
39 + g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE);
41 + if (manager->priv->phase != GSM_MANAGER_PHASE_RUNNING) {
44 + GSM_MANAGER_ERROR_NOT_IN_RUNNING,
45 + "RequestReboot interface is only available during the Running phase");
49 + request_reboot (manager);
55 gsm_manager_shutdown (GsmManager *manager,
58 Index: gnome-session-2.32.1/gnome-session/gsm-manager.h
59 ===================================================================
60 --- gnome-session-2.32.1.orig/gnome-session/gsm-manager.h 2010-11-17 16:23:45.999939999 +0100
61 +++ gnome-session-2.32.1/gnome-session/gsm-manager.h 2010-11-17 16:23:50.203940000 +0100
64 gboolean *is_inhibited,
67 +gboolean gsm_manager_request_shutdown (GsmManager *manager,
69 +gboolean gsm_manager_request_reboot (GsmManager *manager,
71 gboolean gsm_manager_shutdown (GsmManager *manager,
74 Index: gnome-session-2.32.1/gnome-session/org.gnome.SessionManager.xml
75 ===================================================================
76 --- gnome-session-2.32.1.orig/gnome-session/org.gnome.SessionManager.xml 2010-11-17 16:23:46.007939999 +0100
77 +++ gnome-session-2.32.1/gnome-session/org.gnome.SessionManager.xml 2010-11-17 16:23:50.203940000 +0100
82 + <method name="RequestShutdown">
85 + <doc:para>Request a shutdown with no dialog</doc:para>
90 + <method name="RequestReboot">
93 + <doc:para>Request a reboot with no dialog</doc:para>
101 <signal name="ClientAdded">