Commit 7656d806 authored by Vincent Untz's avatar Vincent Untz Committed by Vincent Untz

Allow an interacting app to cancel the logout.

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

	Allow an interacting app to cancel the logout.

	* gnome-session/gsm-client.[ch]: (gsm_client_class_init): add new
	cancel argument to END_SESSION_RESPONSE signal
	(gdm_client_end_session_response): add cancel and use it
	* gnome-session/gsm-marshal.list: updated for new signature
	* gnome-session/gsm-manager.c: (on_client_end_session_response): add
	cancel paramter, and call cancel_end_session if cancel is TRUE
	* gnome-session/gsm-dbus-client.c: (handle_end_session_response): pass
	FALSE as cancel
	* gnome-session/gsm-xsmp-client.c:
	(save_yourself_phase2_request_callback): pass FALSE as cancel
	(interact_request_callback): pass FALSE as cancel
	(interact_done_callback): pass the value returned by the client as
	cancel
	(save_yourself_done_callback): pass FALSE as cancel

svn path=/trunk/; revision=5359
parent f3d82410
2009-03-25 Vincent Untz <vuntz@gnome.org>
Allow an interacting app to cancel the logout.
* gnome-session/gsm-client.[ch]: (gsm_client_class_init): add new
cancel argument to END_SESSION_RESPONSE signal
(gdm_client_end_session_response): add cancel and use it
* gnome-session/gsm-marshal.list: updated for new signature
* gnome-session/gsm-manager.c: (on_client_end_session_response): add
cancel paramter, and call cancel_end_session if cancel is TRUE
* gnome-session/gsm-dbus-client.c: (handle_end_session_response): pass
FALSE as cancel
* gnome-session/gsm-xsmp-client.c:
(save_yourself_phase2_request_callback): pass FALSE as cancel
(interact_request_callback): pass FALSE as cancel
(interact_done_callback): pass the value returned by the client as
cancel
(save_yourself_done_callback): pass FALSE as cancel
2009-03-25 Vincent Untz <vuntz@gnome.org>
Actually allow XSMP clients to interact during the logout. It works
......
......@@ -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_STRING,
gsm_marshal_VOID__BOOLEAN_BOOLEAN_STRING,
G_TYPE_NONE,
2, G_TYPE_BOOLEAN, G_TYPE_STRING);
3, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_STRING);
g_object_class_install_property (object_class,
PROP_STARTUP_ID,
......@@ -522,7 +522,9 @@ gsm_client_save (GsmClient *client,
void
gdm_client_end_session_response (GsmClient *client,
gboolean is_ok,
gboolean cancel,
const char *reason)
{
g_signal_emit (client, signals[END_SESSION_RESPONSE], 0, is_ok, reason);
g_signal_emit (client, signals[END_SESSION_RESPONSE], 0,
is_ok, cancel, reason);
}
......@@ -73,6 +73,7 @@ struct _GsmClientClass
void (*disconnected) (GsmClient *client);
void (*end_session_response) (GsmClient *client,
gboolean ok,
gboolean cancel,
const char *reason);
/* virtual methods */
......@@ -159,6 +160,7 @@ gboolean gsm_client_get_unix_process_id (GsmClient *client,
void gdm_client_end_session_response (GsmClient *client,
gboolean is_ok,
gboolean cancel,
const char *reason);
G_END_DECLS
......
......@@ -189,7 +189,8 @@ handle_end_session_response (GsmDBusClient *client,
g_error ("No memory");
}
gdm_client_end_session_response (GSM_CLIENT (client), is_ok, reason);
gdm_client_end_session_response (GSM_CLIENT (client),
is_ok, FALSE, reason);
if (! dbus_connection_send (client->priv->connection, reply, NULL)) {
......
......@@ -1668,6 +1668,7 @@ out:
static void
on_client_end_session_response (GsmClient *client,
gboolean is_ok,
gboolean cancel,
const char *reason,
GsmManager *manager)
{
......@@ -1676,7 +1677,12 @@ on_client_end_session_response (GsmClient *client,
return;
}
g_debug ("GsmManager: Response from end session request: is-ok=%d reason=%s", is_ok, reason);
g_debug ("GsmManager: Response from end session request: is-ok=%d cancel=%d reason=%s", is_ok, cancel, reason);
if (cancel) {
cancel_end_session (manager);
return;
}
manager->priv->query_clients = g_slist_remove (manager->priv->query_clients, client);
......
BOOLEAN:POINTER
VOID:BOOLEAN,STRING
VOID:BOOLEAN,BOOLEAN,STRING
......@@ -1153,7 +1153,7 @@ 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,
TRUE, FALSE,
NULL);
/* FIXME: change priority so this client runs at the end? */
......@@ -1175,7 +1175,7 @@ interact_request_callback (SmsConn conn,
dialog_type == SmDialogNormal ? "Dialog" : "Errors");
gdm_client_end_session_response (GSM_CLIENT (client),
FALSE,
FALSE, FALSE,
_("This program is blocking log out."));
#if 0
......@@ -1206,7 +1206,7 @@ interact_done_callback (SmsConn conn,
cancel_shutdown ? "True" : "False");
gdm_client_end_session_response (GSM_CLIENT (client),
TRUE,
TRUE, cancel_shutdown,
NULL);
}
......@@ -1228,7 +1228,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,
TRUE, 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