...
 
Commits (12)
What's new in at-spi2-core 2.18.3:
* get_index_in_parent: Don't crash if the parent is defunct.
What's new in at-spi2-core 2.18.2:
* Really don't crash if we get a children-changed event with a
non-existent child (bgo#755951).
* Fixed crash during removal of last application in registryd (bgo#756513).
What's new in at-spi2-core 2.18.1:
* Don't crash if we get a children-changed event with a non-existent
child (bgo#755951).
* atspi_hyperlink_get_index_range: don't return random values if the
call fails (bgo#755727).
* Fixed some atspi_text_ functions (bgo#755731).
What's new in at-spi2-core 2.17.90:
* Modified the cache API to specify an object's index and child count
......
......@@ -399,11 +399,15 @@ atspi_accessible_get_index_in_parent (AtspiAccessible *obj, GError **error)
if (!obj->accessible_parent)
return -1;
if (!_atspi_accessible_test_cache (obj->accessible_parent, ATSPI_CACHE_CHILDREN) || !obj->accessible_parent->children)
goto dbus;
for (i = 0; i < obj->accessible_parent->children->len; i++)
if (g_ptr_array_index (obj->accessible_parent->children, i) == obj)
return i;
}
dbus:
_atspi_dbus_call (obj, atspi_interface_accessible,
"GetIndexInParent", NULL, "=>i", &ret);
return ret;
......
......@@ -207,6 +207,8 @@ cache_process_children_changed (AtspiEvent *event)
return;
child = g_value_get_object (&event->any_data);
if (child == NULL)
return;
if (!strncmp (event->type, "object:children-changed:add", 27))
{
......
......@@ -133,7 +133,8 @@ atspi_hyperlink_get_object (AtspiHyperlink *obj, gint i, GError **error)
AtspiRange *
atspi_hyperlink_get_index_range (AtspiHyperlink *obj, GError **error)
{
dbus_int32_t d_start_offset, d_end_offset;
dbus_int32_t d_start_offset = -1;
dbus_int32_t d_end_offset = -1;
AtspiRange *ret = g_new (AtspiRange, 1);
ret->start_offset = ret->end_offset = -1;
......
......@@ -102,11 +102,11 @@ atspi_state_set_set_by_name (AtspiStateSet *set, const gchar *name, gboolean ena
{
g_warning ("AT-SPI: Attempt to set unknown state '%s'", name);
}
if (enabled)
set->states |= ((gint64)1 << value->value);
else
set->states &= ~((gint64)1 << value->value);
if (enabled)
set->states |= ((gint64)1 << value->value);
else
set->states &= ~((gint64)1 << value->value);
g_type_class_unref (type_class);
}
......
......@@ -319,10 +319,14 @@ atspi_text_get_text_attribute_value (AtspiText *obj,
GError **error)
{
gchar *retval = NULL;
dbus_int32_t d_i = offset;
g_return_val_if_fail (obj != NULL, NULL);
_atspi_dbus_call (obj, atspi_interface_text, "GetAttributeValue", error, "i=>s", offset, &retval);
_atspi_dbus_call (obj, atspi_interface_text, "GetAttributeValue", error, "is=>s", d_i, (const gchar *)attribute_value, &retval);
if (!retval)
retval = g_strdup ("");
return retval;
}
......
......@@ -51,6 +51,8 @@ typedef struct {
GSettings *a11y_schema;
GSettings *interface_schema;
GDBusProxy *client_proxy;
A11yBusState state;
/* -1 == error, 0 == pending, > 0 == running */
int a11y_bus_pid;
......@@ -75,6 +77,133 @@ static const gchar introspection_xml[] =
"</node>";
static GDBusNodeInfo *introspection_data = NULL;
static void
respond_to_end_session (GDBusProxy *proxy)
{
GVariant *parameters;
parameters = g_variant_new ("(bs)", TRUE, "");
g_dbus_proxy_call (proxy,
"EndSessionResponse", parameters,
G_DBUS_CALL_FLAGS_NONE,
-1, NULL, NULL, NULL);
}
static void
g_signal_cb (GDBusProxy *proxy,
gchar *sender_name,
gchar *signal_name,
GVariant *parameters,
gpointer user_data)
{
A11yBusLauncher *app = user_data;
if (g_strcmp0 (signal_name, "QueryEndSession") == 0)
respond_to_end_session (proxy);
else if (g_strcmp0 (signal_name, "EndSession") == 0)
respond_to_end_session (proxy);
else if (g_strcmp0 (signal_name, "Stop") == 0)
g_main_loop_quit (app->loop);
}
static void
client_proxy_ready_cb (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
A11yBusLauncher *app = user_data;
GError *error = NULL;
app->client_proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
if (error != NULL)
{
g_warning ("Failed to get a client proxy: %s", error->message);
g_error_free (error);
return;
}
g_signal_connect (app->client_proxy, "g-signal",
G_CALLBACK (g_signal_cb), app);
}
static void
register_client (A11yBusLauncher *app)
{
GDBusProxyFlags flags;
GDBusProxy *sm_proxy;
GError *error;
const gchar *app_id;
const gchar *autostart_id;
gchar *client_startup_id;
GVariant *parameters;
GVariant *variant;
gchar *object_path;
flags = G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS;
error = NULL;
sm_proxy = g_dbus_proxy_new_sync (app->session_bus, flags, NULL,
"org.gnome.SessionManager",
"/org/gnome/SessionManager",
"org.gnome.SessionManager",
NULL, &error);
if (error != NULL)
{
g_warning ("Failed to get session manager proxy: %s", error->message);
g_error_free (error);
return;
}
app_id = "at-spi-bus-launcher";
autostart_id = g_getenv ("DESKTOP_AUTOSTART_ID");
if (autostart_id != NULL)
{
client_startup_id = g_strdup (autostart_id);
g_unsetenv ("DESKTOP_AUTOSTART_ID");
}
else
{
client_startup_id = g_strdup ("");
}
parameters = g_variant_new ("(ss)", app_id, client_startup_id);
g_free (client_startup_id);
error = NULL;
variant = g_dbus_proxy_call_sync (sm_proxy,
"RegisterClient", parameters,
G_DBUS_CALL_FLAGS_NONE,
-1, NULL, &error);
g_object_unref (sm_proxy);
if (error != NULL)
{
g_warning ("Failed to register client: %s", error->message);
g_error_free (error);
return;
}
g_variant_get (variant, "(o)", &object_path);
g_variant_unref (variant);
flags = G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES;
g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION, flags, NULL,
"org.gnome.SessionManager", object_path,
"org.gnome.SessionManager.ClientPrivate",
NULL, client_proxy_ready_cb, app);
g_free (object_path);
}
static void
setup_bus_child (gpointer data)
{
......@@ -454,7 +583,8 @@ on_name_acquired (GDBusConnection *connection,
gpointer user_data)
{
A11yBusLauncher *app = user_data;
(void) app;
register_client (app);
}
static int sigterm_pipefd[2];
......
AC_INIT([at-spi2-core], [2.18.0], [accessibility-atspi@lists.linux-foundation.org])
AC_INIT([at-spi2-core], [2.18.3], [accessibility-atspi@lists.linux-foundation.org])
AC_PREREQ([2.59])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR([m4])
......
......@@ -110,9 +110,6 @@ namespace org.freestandards.atspi {
string attribute_key;
} reply {
string attribute_value;
int32 start_offset;
int32 end_offset;
boolean defined;
}
/* Deprecated in favor of GetAttributeRun. */
......
......@@ -556,9 +556,6 @@ const char *spi_org_a11y_atspi_Text =
" <arg direction=\"in\" name=\"offset\" type=\"i\" />"
" <arg direction=\"in\" name=\"attributeName\" type=\"s\" />"
" <arg direction=\"out\" type=\"s\" />"
" <arg direction=\"out\" name=\"startOffset\" type=\"i\" />"
" <arg direction=\"out\" name=\"endOffset\" type=\"i\" />"
" <arg direction=\"out\" name=\"defined\" type=\"b\" />"
" </method>"
""
" <method name=\"GetAttributes\">"
......
......@@ -144,11 +144,12 @@ find_index_of_reference (GPtrArray *arr, const gchar *name, const gchar * path,
ref = spi_reference_new (name, path);
for (i = 0; i < arr->len && found == FALSE; i++)
for (i = 0; i < arr->len; i++)
{
if (compare_reference (ref, g_ptr_array_index (arr, i)));
if (compare_reference (ref, g_ptr_array_index (arr, i)))
{
found = TRUE;
break;
}
}
......
......@@ -58,9 +58,6 @@
<arg direction="in" name="offset" type="i"/>
<arg direction="in" name="attributeName" type="s"/>
<arg direction="out" type="s"/>
<arg direction="out" name="startOffset" type="i"/>
<arg direction="out" name="endOffset" type="i"/>
<arg direction="out" name="defined" type="b"/>
</method>
<method name="GetAttributes">
......