Commit 4f6fc3f9 authored by Vincent Untz's avatar Vincent Untz Committed by Vincent Untz

Allow clients to specify that they want to be ended last (this mainly

2009-03-25  Vincent Untz  <vuntz@gnome.org>

	Allow clients to specify that they want to be ended last (this mainly
	matches the Phase2 of SaveYourself in XSMP). The server doesn't use
	this information yet.

	* gnome-session/gsm-client.[ch]: (gsm_client_class_init): add new
	do_last argument to END_SESSION_RESPONSE signal
	(gdm_client_end_session_response): add do_last and use it
	* gnome-session/gsm-marshal.list: updated for new signature
	* gnome-session/gsm-manager.c: (on_client_end_session_response): add
	do_last parameter, unused for now
	* gnome-session/gsm-dbus-client.c: (handle_end_session_response): pass
	FALSE as do_last
	* gnome-session/gsm-xsmp-client.c:
	(save_yourself_phase2_request_callback): pass TRUE as do_last since
	that's what the phase2 is
	(interact_request_callback): pass FALSE as do_last
	(interact_done_callback): pass FALSE as do_last
	(save_yourself_done_callback): pass FALSE as do_last

svn path=/trunk/; revision=5361
parent 4670e652
2009-03-25 Vincent Untz <vuntz@gnome.org>
Allow clients to specify that they want to be ended last (this mainly
matches the Phase2 of SaveYourself in XSMP). The server doesn't use
this information yet.
* gnome-session/gsm-client.[ch]: (gsm_client_class_init): add new
do_last argument to END_SESSION_RESPONSE signal
(gdm_client_end_session_response): add do_last and use it
* gnome-session/gsm-marshal.list: updated for new signature
* gnome-session/gsm-manager.c: (on_client_end_session_response): add
do_last parameter, unused for now
* gnome-session/gsm-dbus-client.c: (handle_end_session_response): pass
FALSE as do_last
* gnome-session/gsm-xsmp-client.c:
(save_yourself_phase2_request_callback): pass TRUE as do_last since
that's what the phase2 is
(interact_request_callback): pass FALSE as do_last
(interact_done_callback): pass FALSE as do_last
(save_yourself_done_callback): pass FALSE as do_last
2009-03-25 Vincent Untz <vuntz@gnome.org>
* gnome-session/gsm-manager.c: (do_phase_end_session),
......
......@@ -324,9 +324,9 @@ gsm_client_class_init (GsmClientClass *klass)
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GsmClientClass, end_session_response),
NULL, NULL,
gsm_marshal_VOID__BOOLEAN_BOOLEAN_STRING,
gsm_marshal_VOID__BOOLEAN_BOOLEAN_BOOLEAN_STRING,
G_TYPE_NONE,
3, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_STRING);
4, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_STRING);
g_object_class_install_property (object_class,
PROP_STARTUP_ID,
......@@ -522,9 +522,10 @@ gsm_client_save (GsmClient *client,
void
gdm_client_end_session_response (GsmClient *client,
gboolean is_ok,
gboolean do_last,
gboolean cancel,
const char *reason)
{
g_signal_emit (client, signals[END_SESSION_RESPONSE], 0,
is_ok, cancel, reason);
is_ok, do_last, cancel, reason);
}
......@@ -73,6 +73,7 @@ struct _GsmClientClass
void (*disconnected) (GsmClient *client);
void (*end_session_response) (GsmClient *client,
gboolean ok,
gboolean do_last,
gboolean cancel,
const char *reason);
......@@ -160,6 +161,7 @@ gboolean gsm_client_get_unix_process_id (GsmClient *client,
void gdm_client_end_session_response (GsmClient *client,
gboolean is_ok,
gboolean do_last,
gboolean cancel,
const char *reason);
......
......@@ -190,7 +190,7 @@ handle_end_session_response (GsmDBusClient *client,
}
gdm_client_end_session_response (GSM_CLIENT (client),
is_ok, FALSE, reason);
is_ok, FALSE, FALSE, reason);
if (! dbus_connection_send (client->priv->connection, reply, NULL)) {
......
......@@ -1667,6 +1667,7 @@ out:
static void
on_client_end_session_response (GsmClient *client,
gboolean is_ok,
gboolean do_last,
gboolean cancel,
const char *reason,
GsmManager *manager)
......@@ -1676,7 +1677,7 @@ on_client_end_session_response (GsmClient *client,
return;
}
g_debug ("GsmManager: Response from end session request: is-ok=%d cancel=%d reason=%s", is_ok, cancel, reason);
g_debug ("GsmManager: Response from end session request: is-ok=%d do-last=%d cancel=%d reason=%s", is_ok, do_last, cancel, reason);
if (cancel) {
cancel_end_session (manager);
......
BOOLEAN:POINTER
VOID:BOOLEAN,BOOLEAN,STRING
VOID:BOOLEAN,BOOLEAN,BOOLEAN,STRING
......@@ -1153,10 +1153,8 @@ save_yourself_phase2_request_callback (SmsConn conn,
/* this is a valid response to SaveYourself and therefore
may be a response to a QES or ES */
gdm_client_end_session_response (GSM_CLIENT (client),
TRUE, FALSE,
TRUE, TRUE, FALSE,
NULL);
/* FIXME: change priority so this client runs at the end? */
}
static void
......@@ -1175,7 +1173,7 @@ interact_request_callback (SmsConn conn,
dialog_type == SmDialogNormal ? "Dialog" : "Errors");
gdm_client_end_session_response (GSM_CLIENT (client),
FALSE, FALSE,
FALSE, FALSE, FALSE,
_("This program is blocking log out."));
#if 0
......@@ -1206,7 +1204,7 @@ interact_done_callback (SmsConn conn,
cancel_shutdown ? "True" : "False");
gdm_client_end_session_response (GSM_CLIENT (client),
TRUE, cancel_shutdown,
TRUE, FALSE, cancel_shutdown,
NULL);
}
......@@ -1228,7 +1226,7 @@ save_yourself_done_callback (SmsConn conn,
* the session manager can do about, though. FIXME: we could display a
* dialog about this, I guess. */
gdm_client_end_session_response (GSM_CLIENT (client),
TRUE, FALSE,
TRUE, FALSE, FALSE,
NULL);
if (client->priv->next_save_yourself) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment