From d68f26bd70933df9d18d88e98c2079ce8c2f3dc2 Mon Sep 17 00:00:00 2001 From: Peng Huang Date: Fri, 18 Feb 2011 10:58:27 -0500 Subject: [PATCH] Fix crash when turn off "use global engine" option BUG=none TEST=Linux desktop Review URL: http://codereview.appspot.com/4170061 --- bus/ibusimpl.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c index d02f314..86b9052 100644 --- a/bus/ibusimpl.c +++ b/bus/ibusimpl.c @@ -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) { -- 2.7.4