/* -*- mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
- *
- * at-spi-bus-launcher: Manage the a11y bus as a child process
+ *
+ * at-spi-bus-launcher: Manage the a11y bus as a child process
*
* Copyright 2011 Red Hat, Inc.
*
#ifdef __linux
#include <sys/prctl.h>
prctl (PR_SET_PDEATHSIG, 15);
-#endif
+#endif
}
/**
gpointer data)
{
A11yBusLauncher *app = data;
-
+
app->a11y_bus_pid = -1;
app->state = A11Y_BUS_STATE_ERROR;
if (app->a11y_launch_error_message == NULL)
app->a11y_launch_error_message = g_strdup_printf ("Bus stopped by signal %d", WSTOPSIG (status));
}
g_main_loop_quit (app->loop);
-}
+}
static gboolean
ensure_a11y_bus (A11yBusLauncher *app)
if (app->a11y_bus_pid != 0)
return FALSE;
-
+
argv[1] = g_strdup_printf ("--config-file=%s/at-spi2/accessibility.conf", SYSCONFDIR);
if (pipe (app->pipefd) < 0)
g_error ("Failed to create pipe: %s", strerror (errno));
-
+
if (!g_spawn_async (NULL,
argv,
NULL,
}
#endif
+ if (argv[1]) g_free(argv[1]);
+
return TRUE;
-
+
error:
+ if (argv[1]) g_free(argv[1]);
close (app->pipefd[0]);
close (app->pipefd[1]);
app->state = A11Y_BUS_STATE_ERROR;
A11yBusLauncher *app = user_data;
const gchar *type = g_variant_get_type_string (value);
gboolean enabled;
-
+
if (g_strcmp0 (type, "b") != 0)
{
g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS,
A11yBusLauncher *app = user_data;
GError *error;
guint registration_id;
-
+
if (connection == NULL)
{
g_main_loop_quit (app->loop);
gpointer data)
{
A11yBusLauncher *app = data;
-
+
g_main_loop_quit (app->loop);
return FALSE;
bridge_display = XOpenDisplay (NULL);
if (!bridge_display)
return FALSE;
-
+
AT_SPI_BUS = XInternAtom (bridge_display, "AT_SPI_BUS", False);
XGetWindowProperty (bridge_display,
XDefaultRootWindow (bridge_display),
if (_global_app->a11y_bus_pid > 0)
kill (_global_app->a11y_bus_pid, SIGTERM);
- /* Clear the X property if our bus is gone; in the case where e.g.
+ /* Clear the X property if our bus is gone; in the case where e.g.
* GDM is launching a login on an X server it was using before,
* we don't want early login processes to pick up the stale address.
*/
{
AtspiStateSet *node_state_set = atspi_accessible_get_state_set(node);
GArray *states = atspi_state_set_get_states(node_state_set);
+ if (!states) return NULL;
g_array_sort(states, _int_sort_function);
AtspiStateType state_type;
char *state_string = NULL;
- for (int i = 0; states && (i < states->len); i++) {
+ for (int i = 0; i < states->len; i++) {
state_type = g_array_index(states, AtspiStateType, i);
char node_state_str[8];