summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gorse <mgorse@suse.com>2013-07-01 14:32:23 -0500
committerMike Gorse <mgorse@suse.com>2013-07-01 14:32:23 -0500
commitd402265f4f92474d1a20ad3f55d0405724031214 (patch)
tree1390f94f96e44a61e88c7d52488a009d2b35b3d6
parentfeb130feb6e8df6228ddbe0054f035725a8ee70a (diff)
downloadat-spi2-core-d402265f4f92474d1a20ad3f55d0405724031214.tar.gz
Add atspi_set_main_context
Add a function to allow at-spi2-atk to set the main context that is used when adding idle handlers (ie, process_deferred_messages, which is used to prevent new events from being sent to the AT while other events are being processed). Also bump version to 2.9.4.
-rw-r--r--atspi/atspi-misc.c26
-rw-r--r--atspi/atspi-misc.h3
-rw-r--r--configure.ac2
3 files changed, 29 insertions, 2 deletions
diff --git a/atspi/atspi-misc.c b/atspi/atspi-misc.c
index c9fa0aed..be908b59 100644
--- a/atspi/atspi-misc.c
+++ b/atspi/atspi-misc.c
@@ -35,6 +35,7 @@
#include <string.h>
static void handle_get_items (DBusPendingCall *pending, void *user_data);
+gboolean _atspi_process_deferred_messages (gpointer data);
static DBusConnection *bus = NULL;
static GHashTable *live_refs = NULL;
@@ -42,6 +43,7 @@ static gint method_call_timeout = 800;
static gint app_startup_time = 15000;
GMainLoop *atspi_main_loop;
+GMainContext *atspi_main_context;
gboolean atspi_no_cache;
const char *atspi_path_dec = ATSPI_DBUS_PATH_DEC;
@@ -798,7 +800,13 @@ defer_message (DBusConnection *connection, DBusMessage *message, void *user_data
g_queue_push_tail (deferred_messages, closure);
if (process_deferred_messages_id == -1)
- process_deferred_messages_id = g_idle_add (_atspi_process_deferred_messages, NULL);
+ {
+ GSource *source = g_idle_source_new ();
+ g_source_set_callback (source, _atspi_process_deferred_messages, NULL, NULL);
+ process_deferred_messages_id = g_source_attach (source, atspi_main_context);
+ g_source_unref (source);
+ }
+
return DBUS_HANDLER_RESULT_HANDLED;
}
@@ -1623,6 +1631,22 @@ atspi_set_timeout (gint val, gint startup_time)
app_startup_time = startup_time;
}
+/*
+ * atspi_set_main_context:
+ * @cnx: The #GmainContext to use.
+ *
+ * Sets the main loop context that AT-SPI should assume is in use when
+ * setting an idle callback.
+ * This function should be called by application-side implementors (ie,
+ * at-spi2-atk) when it is desirable to re-enter the main loop.
+ */
+void
+atspi_set_main_context (GMainContext *cnx)
+{
+ atspi_main_context = cnx;
+ atspi_dbus_connection_setup_with_g_main (atspi_get_a11y_bus (), cnx);
+}
+
#ifdef DEBUG_REF_COUNTS
static void
print_disposed (gpointer key, gpointer value, gpointer data)
diff --git a/atspi/atspi-misc.h b/atspi/atspi-misc.h
index 4e9677ec..f13596fd 100644
--- a/atspi/atspi-misc.h
+++ b/atspi/atspi-misc.h
@@ -43,6 +43,9 @@ atspi_get_a11y_bus ();
void
atspi_set_timeout (gint val, gint startup_time);
+void
+atspi_set_main_context (GMainContext *cnx);
+
gchar * atspi_role_get_name (AtspiRole role);
G_END_DECLS
diff --git a/configure.ac b/configure.ac
index 227d6ad4..a75d6d39 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-AC_INIT([at-spi2-core], [2.9.3], [accessibility-atspi@lists.linux-foundation.org])
+AC_INIT([at-spi2-core], [2.9.4], [accessibility-atspi@lists.linux-foundation.org])
AC_PREREQ([2.59])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR([m4])