From d5b7da193b99a8826027de7b961032091b48fa87 Mon Sep 17 00:00:00 2001 From: infirit Date: Sat, 12 Sep 2015 12:03:15 +0200 Subject: Return error when authentication dialog is dismissed This allows PolicyKit applications to disambiguate between when the authentication dialog is dismissed versus when authentication fails (e.g. the wrong password has been entered). From polkit-gnome, commit: 2511afae6b72fe3b4714d07ab6373c93c2923a5e From: David Zeuthen Gnome bug: https://bugs.freedesktop.org/show_bug.cgi?id=30653 --- src/polkitmateauthenticator.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/polkitmateauthenticator.c') diff --git a/src/polkitmateauthenticator.c b/src/polkitmateauthenticator.c index e5fd4c4..93440cd 100644 --- a/src/polkitmateauthenticator.c +++ b/src/polkitmateauthenticator.c @@ -127,6 +127,7 @@ polkit_mate_authenticator_class_init (PolkitMateAuthenticatorClass *klass) * PolkitMateAuthenticator::completed: * @authenticator: A #PolkitMateAuthenticator. * @gained_authorization: Whether the authorization was gained. + * @dismissed: Whether the dialog was dismissed. * * Emitted when the authentication is completed. The user is supposed to dispose of @authenticator * upon receiving this signal. @@ -137,9 +138,10 @@ polkit_mate_authenticator_class_init (PolkitMateAuthenticatorClass *klass) 0, /* class offset */ NULL, /* accumulator */ NULL, /* accumulator data */ - g_cclosure_marshal_VOID__BOOLEAN, + g_cclosure_marshal_generic, G_TYPE_NONE, - 1, + 2, + G_TYPE_BOOLEAN, G_TYPE_BOOLEAN); } @@ -473,7 +475,10 @@ do_initiate (gpointer user_data) } out: - g_signal_emit_by_name (authenticator, "completed", authenticator->gained_authorization); + g_signal_emit_by_name (authenticator, + "completed", + authenticator->gained_authorization, + authenticator->was_cancelled); g_object_unref (authenticator); -- cgit v1.2.1