Fix crash when turn off "use global engine" option
authorPeng Huang <shawn.p.huang@gmail.com>
Fri, 18 Feb 2011 15:58:27 +0000 (10:58 -0500)
committerPeng Huang <shawn.p.huang@gmail.com>
Fri, 18 Feb 2011 15:58:27 +0000 (10:58 -0500)
BUG=none
TEST=Linux desktop

Review URL: http://codereview.appspot.com/4170061

bus/ibusimpl.c

index d02f314bc647c7bfefc2319ff031150a7b9a1996..86b9052bb49065544b28954b8b8c2e1ec3582044 100644 (file)
@@ -472,6 +472,9 @@ bus_ibus_impl_set_use_global_engine (BusIBusImpl *ibus,
     if (new_value) {
         /* turn on use_global_engine option */
         ibus->use_global_engine = TRUE;
+        if (ibus->panel && ibus->focused_context == NULL) {
+            bus_panel_proxy_focus_in (ibus->panel, ibus->fake_context);
+        }
     }
     else {
         /* turn off use_global_engine option */
@@ -709,6 +712,9 @@ _dbus_name_owner_changed_cb (BusDBusImpl *dbus,
             if (ibus->focused_context != NULL) {
                 bus_panel_proxy_focus_in (ibus->panel, ibus->focused_context);
             }
+            else if (ibus->use_global_engine) {
+                bus_panel_proxy_focus_in (ibus->panel, ibus->fake_context);
+            }
         }
     }
     else if (g_strcmp0 (name, IBUS_SERVICE_CONFIG) == 0) {