Modify remote_control_default_text_cb when the remote input mode is changed 38/85838/2
authorInHong Han <inhong1.han@samsung.com>
Mon, 29 Aug 2016 08:01:22 +0000 (17:01 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Tue, 30 Aug 2016 02:05:10 +0000 (19:05 -0700)
Change-Id: I63d77cf015b24ddbd7ae8df0026b98ab26078bb4

ism/src/isf_info_manager.cpp
ism/src/isf_remote_control.cpp

index 6f59317..9570f77 100644 (file)
@@ -261,6 +261,7 @@ class InfoManager::InfoManagerImpl
     int                                 m_current_recv_remoteinput_id;
     IntIntRepository                    m_send_remoteinput_map;
     IntIntRepository                    m_recv_remoteinput_map;
+    bool                                m_remoteinput_status;
 
     int                                 m_last_socket_client;
     uint32                              m_last_client_context;
@@ -395,7 +396,7 @@ public:
           m_active_client_id (-1),
           m_should_shared_ise (false),
           m_ise_exiting (false), m_is_imengine_aux (false), m_is_imengine_candidate (false),
-          m_current_send_remoteinput_id (0), m_current_recv_remoteinput_id (0),
+          m_current_send_remoteinput_id (0), m_current_recv_remoteinput_id (0), m_remoteinput_status (true),
           m_last_socket_client (-1), m_last_client_context (0),
           m_ise_context_buffer (NULL), m_ise_context_length (0) {
         m_current_ise_name = String (_ ("English Keyboard"));
@@ -1376,6 +1377,8 @@ public:
     //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
     bool process_key_event (KeyEvent& key, uint32 serial) {
         LOGD ("");
+        if (m_remoteinput_status) m_remoteinput_status = false;
+
         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
 
         if (it != m_helper_client_index.end ()) {
@@ -2741,6 +2744,8 @@ client context helpers: %d, helpers uuid count: %d",
         SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
         LOGD ("");
 
+        if (m_remoteinput_status) m_remoteinput_status = false;
+
         lock();
         m_panel_agent_manager.socket_remoteinput_focus_in (m_current_recv_remoteinput_id);
         unlock ();
@@ -2768,9 +2773,13 @@ client context helpers: %d, helpers uuid count: %d",
         SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
         LOGD ("");
 
-        lock();
-        m_panel_agent_manager.socket_remoteinput_default_text (m_current_recv_remoteinput_id, text, cursor);
-        unlock ();
+        if (!m_remoteinput_status) {
+            lock();
+            m_panel_agent_manager.socket_remoteinput_default_text (m_current_recv_remoteinput_id, text, cursor);
+            unlock ();
+
+            m_remoteinput_status = true;
+        }
     }
 
     //ISM_TRANS_CMD_UPDATE_SELECTION
index a2ccdad..0a7aae2 100644 (file)
@@ -75,7 +75,6 @@ remote_handler(void *data, Ecore_Fd_Handler *fd_handler)
                     int cursor;
 
                     client->remote_client.get_default_text (default_text, &cursor);
-                    remote_control_update_preedit_string(client, default_text.c_str (), NULL, 0);
                     client->default_text_cb (client->default_text_cb_user_data, strdup (default_text.c_str ()), cursor);
                 }
             }