Fix IBus.Bus.get_config is null.
authorfujiwarat <takao.fujiwara1@gmail.com>
Thu, 27 Sep 2012 01:11:34 +0000 (10:11 +0900)
committerfujiwarat <takao.fujiwara1@gmail.com>
Thu, 27 Sep 2012 01:11:34 +0000 (10:11 +0900)
Now im-ibus.so uses ibus_bus_new_async() instead of ibus_bus_new()
and then if ibus-setup-anthy calls GTK+ UI before ibus_bus_new(),
the async function is called instead and the delay is happened with
the latest ibus 1.5.
The fix is to call ibus_bus_new() before GTK+.

BUG=RH#859585
TEST=Manually

Review URL: https://codereview.appspot.com/6566053

setup/main.py

index 300f11b..8a2391d 100644 (file)
@@ -66,12 +66,20 @@ class Setup(object):
 
     def __init__(self):
         super(Setup, self).__init__()
+
+        # IBus.Bus() calls ibus_bus_new().
+        # Gtk.Builder().add_from_file() also calls ibus_bus_new_async()
+        # via ibus_im_context_new().
+        # Then if IBus.Bus() is called after Gtk.Builder().add_from_file(),
+        # the connection delay would be happened without an async
+        # finish function.
+        self.__bus = None
+        self.__init_bus()
+
         gtk_builder_file = path.join(path.dirname(__file__), "./setup.ui")
         self.__builder = Gtk.Builder()
         self.__builder.set_translation_domain(DOMAINNAME)
         self.__builder.add_from_file(gtk_builder_file);
-        self.__bus = None
-        self.__init_bus()
         self.__init_ui()
 
     def __init_hotkey(self):