Fix issue that IME is launched twice in on-demand mode 49/183249/3
authorInHong Han <inhong1.han@samsung.com>
Tue, 3 Jul 2018 10:26:44 +0000 (19:26 +0900)
committerInHong Han <inhong1.han@samsung.com>
Wed, 4 Jul 2018 10:56:21 +0000 (19:56 +0900)
Change-Id: Id71a41bdd40acdf16ddf779587b6210ff051d328

ism/extras/efl_panel/isf_panel_efl.cpp
ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp
ism/src/isf_info_manager.cpp

index 9aab6fa..ee44dbe 100644 (file)
@@ -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
index 9cbbed4..3690fa4 100644 (file)
@@ -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
index 781fca1..de7d77b 100644 (file)
@@ -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