trouble sending a signal with gdbus

David Zeuthen zeuthen at gmail.com
Fri Feb 10 16:36:35 PST 2012


Hi,

The interface name to use is "org.freedesktop.DBus.Properties", not
"org.freedesktop.DBus". Apart from that, it looks fine ... although
I'd suggest to use a stack-allocated GVariantBuilder (and then
g_variant_builder_init() instead g_variant_builder_new()). Also make
sure to set error to NULL... HTH

    David

On Thu, Feb 9, 2012 at 7:49 PM, Mike Gorse <mgorse at suse.com> wrote:
> Hi all,
>
> I have this code to send a PropertiesChanged signal:
>
>  builder = g_variant_builder_new (G_VARIANT_TYPE_ARRAY);
>  invalidated_builder = g_variant_builder_new (G_VARIANT_TYPE ("as"));
>  g_variant_builder_add (builder, "{sv}", "ScreenReaderEnabled",
>                         g_variant_new_boolean (enabled));
>  result = g_dbus_connection_emit_signal (app->session_bus, NULL,
> "/org/a11y/bus",
>                                 "org.freedesktop.DBus", "PropertiesChanged",
>                                 g_variant_new ("(sa{sv}as)",
> "org.a11y.Status",
>                                                builder,
>                                                invalidated_builder),
>                                 &error);
>
> Does anyone see a problem with the above? It reportedly does not send the
> signal on one person's system, although the g_dbus_connection_emit_signal
> returns TRUE and does not set an error. The signal is sent correctly on my
> system, so I'm very confused. I tried adding
>
>  g_dbus_connection_flush (app->session_bus, NULL, NULL, NULL);
>
> but this does not seem to help.
>
> Thanks,
> -Mike
> _______________________________________________
> dbus mailing list
> dbus at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dbus


More information about the dbus mailing list