Comment 13 for bug 857153

Revision history for this message
In , Trevor Saunders (trev-saunders) wrote :

(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #5)
> Comment on attachment 568753 [diff] [details] [review]
> Proposed patch.
>
> Review of attachment 568753 [diff] [details] [review]:
> -----------------------------------------------------------------
>
> ::: accessible/src/atk/nsApplicationAccessibleWrap.cpp
> @@ +618,5 @@
> > +test_a11y_dbus (bool *out)
> > +{
> > + // XXX following code is copied from widget/src/gtk2/nsWindow.cpp
> > + // we should put it somewhere that can be used from both modules
> > + // see bug 390761
>
> Why not fix this now? You can just make the widget version nonstatic and
> call it from here.
>
> @@ +625,5 @@
> > + DBusConnection *bus;
> > + DBusMessage *message = NULL, *reply = NULL;
> > + DBusMessageIter iter, iter_variant, iter_struct;
> > + dbus_bool_t d_result;
> > + DBusError error;
>
> This is C++ code, just declare these where they're first assigned wherever
> possible
>
> @@ +627,5 @@
> > + DBusMessageIter iter, iter_variant, iter_struct;
> > + dbus_bool_t d_result;
> > + DBusError error;
> > + const char *iface = "org.a11y.Status";
> > + const char *member = "IsEnabled";
>
> static const char iface[] = ...;
> static const char member[] = ...;
>
> @@ +636,5 @@
> > + goto exit;
> > +
> > + message = dbus_message_new_method_call ("org.a11y.Bus", "/org/a11y/bus",
> > + "org.freedesktop.DBus.Properties",
> > + "Get");
>
> How fast is this? We're calling this on every widget creation, could this be
> slow?

oh? it probably isn't the fastest thing in the world, but I'm not really sure. If that code runs every time we create a widget (which I assume we do a lot) we should probably get rid of the gconf check there too. I'm not sure how fast gconf is, but I can't see it being terriffic.

The really correct solution here would be to call the dbus method once on startup, and then ask dbus to send us a signal when it changes, but I for one have no idea how easy that will be to do (I don't know anything about how gecko currently interacts with dbus)