From: Mike Gorse Date: Fri, 2 Jun 2017 21:26:33 +0000 (-0500) Subject: Poll direct dbus connections in the main loop X-Git-Tag: AT_SPI2_CORE_2_25_3~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c475b5c753df3130e29df40278fe305246a424e2;p=platform%2Fupstream%2Fat-spi2-core.git Poll direct dbus connections in the main loop If a process was marked as hung, then we send a ping with the intention of removing it from the list of hung processes when a reply to the ping is received. However, we weren't necessarily polling the connection, so we wouldn't see the reply to the ping, meaning that the process could be marked as hung indefinitely. https://bugzilla.mozilla.org/show_bug.cgi?id=789038 --- diff --git a/atspi/atspi-misc.c b/atspi/atspi-misc.c index 1dcc3de..89fe9e7 100644 --- a/atspi/atspi-misc.c +++ b/atspi/atspi-misc.c @@ -198,6 +198,7 @@ handle_get_bus_address (DBusPendingCall *pending, void *user_data) dbus_connection_unref (app->bus); } app->bus = bus; + atspi_dbus_connection_setup_with_g_main(bus, g_main_context_default()); } else { @@ -1019,7 +1020,6 @@ static GSList *hung_processes; static void remove_hung_process (DBusPendingCall *pending, void *data) { - hung_processes = g_slist_remove (hung_processes, data); g_free (data); dbus_pending_call_unref (pending); @@ -1676,6 +1676,17 @@ atspi_set_main_context (GMainContext *cnx) } atspi_main_context = cnx; atspi_dbus_connection_setup_with_g_main (atspi_get_a11y_bus (), cnx); + + if (desktop) + { + gint i; + for (i = desktop->children->len - 1; i >= 0; i--) + { + AtspiAccessible *child = g_ptr_array_index (desktop->children, i); + if (child->parent.app && child->parent.app->bus) + atspi_dbus_connection_setup_with_g_main (child->parent.app->bus, cnx); + } + } } #ifdef DEBUG_REF_COUNTS