Set engine before set enable.
authorHuang Peng <shawn.p.huang@gmail.com>
Fri, 27 Jun 2008 07:07:09 +0000 (15:07 +0800)
committerHuang Peng <shawn.p.huang@gmail.com>
Fri, 27 Jun 2008 07:07:09 +0000 (15:07 +0800)
daemon/bus.py

index 5fc27bc..7cb1854 100644 (file)
@@ -126,12 +126,12 @@ class IBus (ibus.Object):
                if is_press and keyval == keysyms.space \
                        and (state & ~modifier.MOD2_MASK) == modifier.CONTROL_MASK:
                        enable = not context.is_enabled ()
-                       context.set_enable (enable)
                        if context.get_engine () == None and enable:
                                factory = self._factory_manager.get_default_factory ()
                                if factory:
                                        engine = factory.create_engine ()
                                        context.set_engine (engine)
+                       context.set_enable (enable)
                        self._panel.states_changed ()
                        return True
                return False