From 1f3da96d5eeb2e60eb1c8cb4fbfa52b83042b0f0 Mon Sep 17 00:00:00 2001 From: InHong Han Date: Fri, 10 Jun 2022 14:12:50 +0900 Subject: [PATCH] Add the new configuration to determine automatic restarting of IME Change-Id: Iee8e434dc6d83e28aa045cd3763a8e725b3ad805 --- ism/configs/global | 1 + ism/extras/efl_panel/isf_panel_efl.cpp | 4 +++- ism/src/isf_info_manager.cpp | 6 ++++-- ism/src/scim_config_path.h | 1 + 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ism/configs/global b/ism/configs/global index 3f2f937..054f599 100755 --- a/ism/configs/global +++ b/ism/configs/global @@ -21,3 +21,4 @@ /LockScreenClassName = LOCK_SCREEN, hub-idlescreen /LaunchRemoteInput = true /LaunchWebServer = true +/EnableAutoRestartIse = true \ No newline at end of file diff --git a/ism/extras/efl_panel/isf_panel_efl.cpp b/ism/extras/efl_panel/isf_panel_efl.cpp index 98910f2..c86bbd6 100644 --- a/ism/extras/efl_panel/isf_panel_efl.cpp +++ b/ism/extras/efl_panel/isf_panel_efl.cpp @@ -459,6 +459,7 @@ static bool _launch_ise_on_request = false; static bool _auto_destroy_ise = false; static bool _soft_keyboard_launched = false; static bool _focus_in = false; +static bool _enable_auto_restart = true; #if ISF_BUILD_CANDIDATE_UI static bool candidate_expanded = false; @@ -2133,6 +2134,7 @@ static void load_config (void) } _launch_ise_on_request = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_LAUNCH_ISE_ON_REQUEST), _launch_ise_on_request); _auto_destroy_ise = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_ENABLE_AUTO_DESTROY_ISE), _auto_destroy_ise); + _enable_auto_restart = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_ENABLE_AUTO_RESTART_ISE), _enable_auto_restart); isf_load_ise_information (ALL_ISE, _config); } @@ -6405,7 +6407,7 @@ static void slot_start_default_ise (void) if (STATUS_DYING == aul_app_get_status (uuid.c_str ())) pid = -1; } - if (_launch_ise_on_request && !_soft_keyboard_launched && pid < 0) { + if ((_launch_ise_on_request || !_enable_auto_restart) && !_soft_keyboard_launched && pid < 0) { LOGD ("Start helper (%s)", uuid.c_str ()); set_keyboard_engine (String (SCIM_COMPOSE_KEY_FACTORY_UUID)); diff --git a/ism/src/isf_info_manager.cpp b/ism/src/isf_info_manager.cpp index 6dfd8aa..4315e12 100644 --- a/ism/src/isf_info_manager.cpp +++ b/ism/src/isf_info_manager.cpp @@ -1541,7 +1541,8 @@ public: m_signal_show_ise (); } else { bool launch_ise_on_request = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_LAUNCH_ISE_ON_REQUEST), false); - if (launch_ise_on_request) + bool enable_auto_restart = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_ENABLE_AUTO_RESTART_ISE), true); + if (launch_ise_on_request || !enable_auto_restart) m_signal_start_default_ise (); } } @@ -3008,6 +3009,7 @@ public: HelperInfoRepository::iterator hiit = m_helper_info_repository.find (client_id); bool launch_ise_on_request = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_LAUNCH_ISE_ON_REQUEST), false); + bool enable_auto_restart = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_ENABLE_AUTO_RESTART_ISE), true); if (hiit != m_helper_info_repository.end ()) { bool restart = false; String uuid = hiit->second.uuid; @@ -3025,7 +3027,7 @@ public: m_signal_stop_default_ise (false); - if (m_refocus_needed || m_reshow_needed || !launch_ise_on_request) + if ((m_refocus_needed || m_reshow_needed || !launch_ise_on_request) && enable_auto_restart) m_restart_needed = true; if (restart && !m_ise_exiting && m_restart_needed) { diff --git a/ism/src/scim_config_path.h b/ism/src/scim_config_path.h index bce31fc..56271e2 100644 --- a/ism/src/scim_config_path.h +++ b/ism/src/scim_config_path.h @@ -96,6 +96,7 @@ namespace scim { #define SCIM_GLOBAL_CONFIG_LOCK_SCREEN_CLASS_NAME "/LockScreenClassName" #define SCIM_GLOBAL_CONFIG_LAUNCH_WEB_SERVER "/LaunchWebServer" #define SCIM_GLOBAL_CONFIG_QUICK_PANEL_ICON_PATH "/QuickpanelIconPath" +#define SCIM_GLOBAL_CONFIG_ENABLE_AUTO_RESTART_ISE "/EnableAutoRestartIse" #define ISF_CONFIG_HARDWARE_KEYBOARD_DETECT "/isf/hw_keyboard_detect" -- 2.7.4