summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInhong Han <inhong1.han@samsung.com>2018-10-19 11:20:34 +0900
committerInHong Han <inhong1.han@samsung.com>2018-10-19 06:35:44 +0000
commit4f139679904c9ae923b44b4b1a48092cd2023d98 (patch)
tree8d3d5cea57b35a4a27bf20b05bfd9267cc907040
parent41239dbf4e2f3c81de79a0d2650da8b247ae04bd (diff)
downloadisf-4f139679904c9ae923b44b4b1a48092cd2023d98.tar.gz
isf-4f139679904c9ae923b44b4b1a48092cd2023d98.tar.bz2
isf-4f139679904c9ae923b44b4b1a48092cd2023d98.zip
Fix the issue that IME doesn't work when ISF was terminated in On-demand mode
Change-Id: I33539fe3a38c46920a5081d4dd3f7324111d5c30
-rw-r--r--ism/extras/efl_panel/isf_panel_efl.cpp37
1 files changed, 23 insertions, 14 deletions
diff --git a/ism/extras/efl_panel/isf_panel_efl.cpp b/ism/extras/efl_panel/isf_panel_efl.cpp
index de92774e..a5c95fc2 100644
--- a/ism/extras/efl_panel/isf_panel_efl.cpp
+++ b/ism/extras/efl_panel/isf_panel_efl.cpp
@@ -290,6 +290,7 @@ static void show_ime_selector_notification (void);
#endif
static void set_language_and_locale (const char *lang_str);
static bool app_control_launch (const char *app_id);
+static void terminate_active_ise (const String uuid);
/////////////////////////////////////////////////////////////////////////////
// Declaration of internal variables.
@@ -6615,6 +6616,24 @@ static void add_ise_check_pid_alive_timer(const String &uuid) {
ise_check_pid_alive_timer, NULL);
}
+static void terminate_active_ise (const String uuid)
+{
+ /* Check if IME with the same AppID is alive */
+ int status_ret = aul_app_get_status (uuid.c_str ());
+ if (status_ret >= STATUS_LAUNCHING) {
+ /* Request to terminate IME */
+ int ime_pid = aul_app_get_pid (uuid.c_str ());
+ status_ret = aul_terminate_pid (ime_pid);
+ if (status_ret < AUL_R_OK) {
+ LOGE ("aul_terminate_pid(%d) failed: %d", ime_pid, status_ret);
+ }
+ else {
+ LOGD ("Requested to terminate IME(%s)", uuid.c_str ());
+ usleep (1000000);
+ }
+ }
+}
+
static void slot_run_helper (const String &uuid, const String &config, const String &display)
{
ISF_SAVE_LOG ("time:%ld pid:%d %s %s uuid(%s)",
@@ -6661,20 +6680,7 @@ static void slot_run_helper (const String &uuid, const String &config, const Str
for (size_t i = 0; i < _ime_info.size (); ++i) {
if (_ime_info[i].appid == uuid && _ime_info[i].module_name.length ()) {
if (scim_helper_path != String (SCIM_HELPER_LAUNCHER_PROGRAM)) {
- /* Check if IME with the same AppID is alive */
- int status_ret = aul_app_get_status (uuid.c_str ());
- if (status_ret >= STATUS_LAUNCHING) {
- /* Request to terminate IME */
- int ime_pid = aul_app_get_pid (uuid.c_str ());
- status_ret = aul_terminate_pid (ime_pid);
- if (status_ret < AUL_R_OK) {
- LOGE ("aul_terminate_pid(%d) failed: %d", ime_pid, status_ret);
- }
- else {
- LOGD ("Requested to terminate IME(%s)", uuid.c_str ());
- usleep (1000000);
- }
- }
+ terminate_active_ise (uuid);
/* execute type IME */
LOGD ("Try to launch IME (%s)", uuid.c_str ());
app_control_launch (uuid.c_str ());
@@ -7956,6 +7962,9 @@ int main (int argc, char *argv [])
}
}
+ /* Request to terminate active IME */
+ terminate_active_ise (_initial_ise_uuid);
+
/* Launches default soft keyboard when all conditions are satisfied */
launch_default_soft_keyboard ();