From 1b5d71d0364ade3b994cb54a63fbca090234fcfc Mon Sep 17 00:00:00 2001 From: InHong Han Date: Tue, 3 Jul 2018 19:26:44 +0900 Subject: [PATCH] Fix issue that IME is launched twice in on-demand mode Change-Id: Id71a41bdd40acdf16ddf779587b6210ff051d328 --- ism/extras/efl_panel/isf_panel_efl.cpp | 9 +++++---- ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp | 6 +++--- ism/src/isf_info_manager.cpp | 8 ++++---- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/ism/extras/efl_panel/isf_panel_efl.cpp b/ism/extras/efl_panel/isf_panel_efl.cpp index 9aab6fa..ee44dbe 100644 --- a/ism/extras/efl_panel/isf_panel_efl.cpp +++ b/ism/extras/efl_panel/isf_panel_efl.cpp @@ -6489,13 +6489,14 @@ static void slot_get_ise_state (int &state) static void slot_start_default_ise (void) { SCIM_DEBUG_MAIN (3) << __FUNCTION__ << "...\n"; - if ((_info_manager->get_current_toolbar_mode () == TOOLBAR_HELPER_MODE)) { - if (_launch_ise_on_request && !_soft_keyboard_launched) { - String uuid = _config->read (SCIM_CONFIG_DEFAULT_HELPER_ISE, String ("")); + if ((_info_manager->get_current_toolbar_mode () == TOOLBAR_HELPER_MODE)) { + String uuid = _config->read (SCIM_CONFIG_DEFAULT_HELPER_ISE, String ("")); + int pid = aul_app_get_pid (uuid.c_str ()); + if (_launch_ise_on_request && !_soft_keyboard_launched && pid < 0) { LOGD ("Start helper (%s)", uuid.c_str ()); - set_keyboard_engine (String (SCIM_COMPOSE_KEY_FACTORY_UUID)); + if (_info_manager->start_helper (uuid)) _soft_keyboard_launched = true; else diff --git a/ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp b/ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp index 9cbbed4..3690fa4 100644 --- a/ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp +++ b/ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp @@ -211,7 +211,7 @@ static bool _need_wl_im_init static struct _wl_im *_wl_im_ctx = NULL; static int _ecore_wl2_init_count = 0; -static bool _destroy_ise = false; +static bool _launch_ise_on_request = false; #define WAYLAND_MODULE_CLIENT_ID (0) #define MAX_PREEDIT_BUFSIZE 4000 @@ -867,7 +867,7 @@ _wsc_im_deactivate (void *data, struct wl_input_method *input_method, struct wl_ _wl_im_ctx->need_focus_event = EINA_FALSE; } - if (_destroy_ise) + if (_launch_ise_on_request) wl_im_destroy (); } @@ -2515,7 +2515,7 @@ panel_initialize (void) _panel_client_id = WAYLAND_MODULE_CLIENT_ID; g_info_manager->register_panel_client (_panel_client_id, _panel_client_id); WSCContextISF* context_scim = _ic_list; - _destroy_ise = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_ENABLE_AUTO_DESTROY_ISE), _destroy_ise); + _launch_ise_on_request = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_LAUNCH_ISE_ON_REQUEST), false); while (context_scim != NULL) { //FIXME:modify the parameter diff --git a/ism/src/isf_info_manager.cpp b/ism/src/isf_info_manager.cpp index 781fca1..de7d77b 100644 --- a/ism/src/isf_info_manager.cpp +++ b/ism/src/isf_info_manager.cpp @@ -1469,7 +1469,9 @@ public: if (ret) { m_signal_show_ise (); } else { - m_signal_start_default_ise (); + bool launch_ise_on_request = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_LAUNCH_ISE_ON_REQUEST), false); + if (launch_ise_on_request) + m_signal_start_default_ise (); } } @@ -2636,10 +2638,8 @@ public: unlock (); bool launch_ise_on_request = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_LAUNCH_ISE_ON_REQUEST), false); - if (!m_ise_exiting && launch_ise_on_request) { - m_ise_exiting = true; + if (launch_ise_on_request) m_signal_start_default_ise (); - } } //SCIM_TRANS_CMD_FOCUS_OUT -- 2.7.4