diff options
author | Bilal Elmoussaoui <bil.elmoussaoui@gmail.com> | 2022-01-12 09:40:49 +0100 |
---|---|---|
committer | Bilal Elmoussaoui <bil.elmoussaoui@gmail.com> | 2022-01-14 08:16:19 +0000 |
commit | 5387be98400f83a32cad47a066261b5ff0950395 (patch) | |
tree | 1bd254f3f7ee4e6f7fb7a2fcbbf48fb133dece49 /libgeoclue | |
parent | 3a8c1daedbd014e8dc31e3d1f801408b67a89a11 (diff) | |
download | geoclue-5387be98400f83a32cad47a066261b5ff0950395.tar.gz |
portals: call xdp_location_call_start_finish
Without it, the Start method fails for obscure reasons
Diffstat (limited to 'libgeoclue')
-rw-r--r-- | libgeoclue/gclue-simple.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/libgeoclue/gclue-simple.c b/libgeoclue/gclue-simple.c index fb299c0..1284e4d 100644 --- a/libgeoclue/gclue-simple.c +++ b/libgeoclue/gclue-simple.c @@ -539,6 +539,23 @@ on_started (GDBusConnection *bus, } static void +on_portal_started_finish (GObject *source_object, + GAsyncResult *res, + gpointer user_data) +{ + GTask *task = G_TASK (user_data); + GClueSimple *simple = g_task_get_source_object (task); + GClueSimplePrivate *priv = simple->priv; + GError *error = NULL; + + if (!xdp_location_call_start_finish (priv->portal, NULL, res, &error)) { + clear_portal (simple); + g_task_return_new_error (priv->task, G_IO_ERROR, G_IO_ERROR_FAILED, "Start failed"); + g_clear_object (&priv->task); + } +} + +static void on_session_created (GObject *source, GAsyncResult *result, gpointer user_data) @@ -588,7 +605,9 @@ on_session_created (GObject *source, priv->session_id, "", /* FIXME parent window */ g_variant_builder_end (&options), - NULL, NULL, NULL); + NULL, + on_portal_started_finish, + task); } static int |