From 52d94a51a0a4b8660a63f14e37ddf5183b052b02 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 18 Jun 2014 15:34:50 -0500 Subject: If we try to prompt for confirmation using unity but the EndSessionDialog errors out, treat that as confirmation. Otherwise how will a user ever log out? --- src/backend-dbus/actions.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/backend-dbus') diff --git a/src/backend-dbus/actions.c b/src/backend-dbus/actions.c index 5447440..c19d02a 100644 --- a/src/backend-dbus/actions.c +++ b/src/backend-dbus/actions.c @@ -635,7 +635,17 @@ on_open_end_session_dialog_ready (GObject * o, { GError * err = NULL; end_session_dialog_call_open_finish (END_SESSION_DIALOG(o), res, &err); - log_and_clear_error (&err, G_STRLOC, G_STRFUNC); + if (err != NULL) + { + if (!g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CANCELLED)) + g_warning ("%s %s: %s", G_STRFUNC, G_STRLOC, err->message); + + /* Treat errors as user confirmation. + Otherwise how will the user ever log out? */ + logout_now(INDICATOR_SESSION_ACTIONS_DBUS(gself)); + + g_clear_error(&err); + } } static void -- cgit v1.2.3