Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 1452 by [email protected]: [PATCH] Add ibus_bus_new_async to asynchronously connect to dbus
http://code.google.com/p/ibus/issues/detail?id=1452

Since ibus_bus_new uses g_dbus_connection_new_for_address_sync, if we cannot connect to dbus for whatever reason, the app may freeze until the timeout is reached, as seen in https://bugs.launchpad.net/ubuntu/+source/vim/+bug/987707 . This patch creates a new function, ibus_bus_new_async and a bit of refactoring to allow connecting to dbus with the asynchronous version of g_dbus_connection_new_for_address. I opted to create a new function rather than modify the existing function because it seems that some portions of the code assume that after ibus_bus_new returns, we will be connected.

This doesn't seem to be the case in the gtk2/3 input methods though, and the second patch uses ibus_bus_new_async there to connect without blocking. This fixes the freeze experienced in the above bug, although more work will be required on the vim code to get ibus working there.

I have included a simple third patch which just copies src/tests/ibus-bus.c to ibus-bus-async.c and modifies it to wait until we get the connected signal, then runs the same tests. The rest of the tests seem to pass (assuming I am running them correctly), except for ibus-inputcontext and ibus-serializable which fail on the master branch without the patches as well. The ibus-config test seems to be racy, and sometimes fails, sometimes succeeds (although if I add g_print statements to the value-changed callback, it almost always succeeds).

Attachments:
        0001-Add-function-ibus_bus_new_async-to-create-a-new-IBus.patch  4.9 KB
        0002-Use-ibus_bus_new_async-in-the-gtk2-client.patch  858 bytes
        0003-Add-tests-for-ibus_bus_new_async.patch  22.2 KB

--
You received this message because you are subscribed to the Google
Groups "ibus-devel" group.
iBus project web page: http://code.google.com/p/ibus/
iBus dev group: http://groups.google.com/group/ibus-devel?hl=en

回复