Modified to call set_prediction_allow() when changing IMEngine 31/269031/9
authorInHong Han <inhong1.han@samsung.com>
Fri, 7 Jan 2022 02:01:07 +0000 (11:01 +0900)
committerInHong Han <inhong1.han@samsung.com>
Thu, 3 Mar 2022 10:44:25 +0000 (19:44 +0900)
Fix issue candidate window is not shown when IMEngine is changed

Change-Id: Idc781dfbba237b21b3908298bb6200195a540581

ism/src/scim_helper.cpp

index ff3ba8c..6960a03 100644 (file)
@@ -176,6 +176,7 @@ public:
     uint32 finalized_cursor_pos;
     bool engine_loader_flag;
     int floating_mode;
+    bool prediction_allow;
 
     HelperAgentSignalVoid           signal_exit;
     HelperAgentSignalVoid           signal_attach_input_context;
@@ -251,7 +252,7 @@ public:
         surrounding_text (NULL), selection_text (NULL), cursor_pos (0),
         need_update_surrounding_text (0), need_update_selection_text (0),
         layout (0), ise_show_flag (false), hw_keyboard_mode (false), need_update_entry_metadata (false), ise_focus_flag (false),
-        finalized_text(NULL), finalized_cursor_pos(0), engine_loader_flag(false), floating_mode(-1) {
+        finalized_text(NULL), finalized_cursor_pos(0), engine_loader_flag(false), floating_mode(-1), prediction_allow(true) {
     }
 
     ~HelperAgentImpl () {
@@ -608,7 +609,7 @@ public:
         }
     }
 private:
-    HelperAgentImpl () : magic (0), magic_active (0), timeout (-1), focused_ic ((uint32) -1), thiz (NULL), surrounding_text (NULL), selection_text (NULL), cursor_pos (0), need_update_surrounding_text (0), need_update_selection_text (0), layout (0), ise_show_flag (false), hw_keyboard_mode (false), need_update_entry_metadata (false), ise_focus_flag (false), finalized_text (NULL), finalized_cursor_pos (0), engine_loader_flag (false), floating_mode (-1) { }
+    HelperAgentImpl () : magic (0), magic_active (0), timeout (-1), focused_ic ((uint32) -1), thiz (NULL), surrounding_text (NULL), selection_text (NULL), cursor_pos (0), need_update_surrounding_text (0), need_update_selection_text (0), layout (0), ise_show_flag (false), hw_keyboard_mode (false), need_update_entry_metadata (false), ise_focus_flag (false), finalized_text (NULL), finalized_cursor_pos (0), engine_loader_flag (false), floating_mode (-1), prediction_allow (true) { }
 };
 
 static MessageQueue message_queue;
@@ -1480,6 +1481,7 @@ HelperAgent::handle_message (MessageItem *message)
         case ISM_TRANS_CMD_SET_PREDICTION_ALLOW:
         {
             MessageItemSetPredictionAllow *subclass = static_cast<MessageItemSetPredictionAllow*>(message);
+            m_impl->prediction_allow = subclass->get_prediction_allow_ref() == 0 ? false : true;
             if (!m_impl->si.null ()) m_impl->si->set_prediction_allow(subclass->get_prediction_allow_ref() == 0 ? false : true);
             m_impl->signal_set_prediction_allow(this, subclass->get_prediction_allow_ref());
             break;
@@ -2537,8 +2539,10 @@ HelperAgent::set_keyboard_ise_by_uuid (const String &uuid) const
     m_impl->attach_instance ();
     ISF_SAVE_LOG ("Require UUID: %s Current UUID: %s", uuid.c_str (), m_impl->si->get_factory_uuid ().c_str ());
     m_impl->si->set_layout (m_impl->layout);
-    if (m_impl->focused_ic != (uint32)-1)
+    if (m_impl->focused_ic != (uint32)-1) {
         m_impl->si->focus_in ();
+        m_impl->si->set_prediction_allow (m_impl->prediction_allow);
+    }
 }
 
 /**