+typedef struct
+{
+ GDBusProxy *proxy;
+ gchar *prop_name;
+} InvalidatedPropGetData;
+
+static void
+invalidated_property_get_cb (GDBusConnection *connection,
+ GAsyncResult *res,
+ gpointer user_data)
+{
+ InvalidatedPropGetData *data = user_data;
+ const gchar *invalidated_properties[] = {NULL};
+ GVariantBuilder builder;
+ GVariant *value = NULL;
+ GVariant *unpacked_value = NULL;
+
+ /* errors are fine, the other end could have disconnected */
+ value = g_dbus_connection_call_finish (connection, res, NULL);
+ if (value == NULL)
+ {
+ goto out;
+ }
+
+ if (!g_variant_is_of_type (value, G_VARIANT_TYPE ("(v)")))
+ {
+ g_warning ("Expected type '(v)' for Get() reply, got '%s'", g_variant_get_type_string (value));
+ goto out;
+ }
+
+ g_variant_get (value, "(v)", &unpacked_value);
+
+ /* synthesize the a{sv} in the PropertiesChanged signal */
+ g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
+ g_variant_builder_add (&builder, "{sv}", data->prop_name, unpacked_value);
+
+ G_LOCK (properties_lock);
+ insert_property_checked (data->proxy,
+ data->prop_name, /* adopts string */
+ unpacked_value); /* adopts value */
+ data->prop_name = NULL;
+ G_UNLOCK (properties_lock);
+
+ g_signal_emit (data->proxy,
+ signals[PROPERTIES_CHANGED_SIGNAL], 0,
+ g_variant_builder_end (&builder), /* consumed */
+ invalidated_properties);
+
+
+ out:
+ if (value != NULL)
+ g_variant_unref (value);
+ g_object_unref (data->proxy);
+ g_free (data->prop_name);
+ g_slice_free (InvalidatedPropGetData, data);
+}
+