Add a GetInterfaces method

It turns out that accerciser depends on this undocumented
method that is not in the xml at all, otherwise interface
sections in the accerciser ui never get enabled.
This commit is contained in:
Matthias Clasen 2020-10-09 23:32:36 -04:00
parent 9d43e5bd59
commit db6bd018ca
3 changed files with 22 additions and 0 deletions

View File

@ -63,5 +63,9 @@
<annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="QSpiObjectReference"/>
</method>
<method name="GetInterfaces">
<arg direction="out" type="as"/>
</method>
</interface>
</node>

View File

@ -28,6 +28,7 @@
#include "gtkatspiutilsprivate.h"
#include "a11y/atspi/atspi-accessible.h"
#include "a11y/atspi/atspi-text.h"
#include "gtkdebug.h"
#include "gtkwindow.h"
@ -371,6 +372,15 @@ handle_accessible_method (GDBusConnection *connection,
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(i)", idx));
}
else if (g_strcmp0 (method_name, "GetInterfaces") == 0)
{
GtkAccessible *accessible = gtk_at_context_get_accessible (GTK_AT_CONTEXT (self));
GVariantBuilder builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("as"));
g_variant_builder_add (&builder, "s", "org.a11y.atspi.Accessible");
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(as)", &builder));
}
}
static GVariant *

View File

@ -331,6 +331,14 @@ handle_accessible_method (GDBusConnection *connection,
{
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(i)", -1));
}
else if (g_strcmp0 (method_name, "GetInterfaces") == 0)
{
GVariantBuilder builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("as"));
g_variant_builder_add (&builder, "s", "org.a11y.atspi.Accessible");
g_variant_builder_add (&builder, "s", "org.a11y.atspi.Application");
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(as)", &builder));
}
}
static GVariant *