diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/location-geoclue2.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/location-geoclue2.c b/src/location-geoclue2.c index 9b9b725..b559196 100644 --- a/src/location-geoclue2.c +++ b/src/location-geoclue2.c @@ -196,13 +196,30 @@ on_name_appeared(GDBusConnection *conn, const gchar *name, g_variant_unref(client_path_v); - /* Set distance threshold */ + /* Set desktop id (basename of the .desktop file) */ error = NULL; GVariant *ret_v = g_dbus_proxy_call_sync(geoclue_client, "org.freedesktop.DBus.Properties.Set", g_variant_new("(ssv)", "org.freedesktop.GeoClue2.Client", + "DesktopId", + g_variant_new("s", "redshift")), + G_DBUS_CALL_FLAGS_NONE, + -1, NULL, &error); + if (ret_v == NULL) { + /* Ignore this error for now. The property is not available + in early versions of GeoClue2. */ + } else { + g_variant_unref(ret_v); + } + + /* Set distance threshold */ + error = NULL; + ret_v = g_dbus_proxy_call_sync(geoclue_client, + "org.freedesktop.DBus.Properties.Set", + g_variant_new("(ssv)", + "org.freedesktop.GeoClue2.Client", "DistanceThreshold", g_variant_new("u", 50000)), G_DBUS_CALL_FLAGS_NONE, |