diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2014-06-18 15:34:50 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2014-06-18 15:34:50 -0500 |
commit | 52d94a51a0a4b8660a63f14e37ddf5183b052b02 (patch) | |
tree | 631eaa41e056641e6c1d14a954e65664acef7491 | |
parent | 96bc6e532df0611fb12fdcb4ccb346a248461d58 (diff) | |
download | ayatana-indicator-session-52d94a51a0a4b8660a63f14e37ddf5183b052b02.tar.gz ayatana-indicator-session-52d94a51a0a4b8660a63f14e37ddf5183b052b02.tar.bz2 ayatana-indicator-session-52d94a51a0a4b8660a63f14e37ddf5183b052b02.zip |
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?
-rw-r--r-- | src/backend-dbus/actions.c | 12 |
1 files changed, 11 insertions, 1 deletions
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 |