From 0e302d7f790f7d04d6923cb5cc3ab13e6127a2af Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Sun, 5 Mar 2017 15:52:03 +0900 Subject: [PATCH] Flush ISE's message buffer after sync message transmission completes When ISE waits for sync message reply such as get_surrounding_text, the messages received before the sync reply message are kept in ISE's message buffer, but these will not be processed until further messages are received after the sync reply message. For this reason, added "Flush Buffer" command to explicitly flush all currently pending messages. Change-Id: Ibb57efda1ecd6ff74456dfc913d9f6ad684fef2d --- .../ecoresocket/ecore_socket_panel_agent_module.cpp | 10 ++++++++++ ism/src/isf_message_queue.h | 14 ++++++++++++++ ism/src/scim_trans_commands.h | 1 + 3 files changed, 25 insertions(+) diff --git a/ism/modules/panelagent/ecoresocket/ecore_socket_panel_agent_module.cpp b/ism/modules/panelagent/ecoresocket/ecore_socket_panel_agent_module.cpp index 4d02639..d7de336 100644 --- a/ism/modules/panelagent/ecoresocket/ecore_socket_panel_agent_module.cpp +++ b/ism/modules/panelagent/ecoresocket/ecore_socket_panel_agent_module.cpp @@ -1050,6 +1050,11 @@ private: m_send_trans.put_data(text); m_send_trans.put_data(cursor); m_send_trans.write_to_socket(client_socket); + + m_send_trans.clear(); + m_send_trans.put_command(SCIM_TRANS_CMD_REPLY); + m_send_trans.put_command(ISM_TRANS_CMD_FLUSH_BUFFER); + m_send_trans.write_to_socket(client_socket); } void socket_remoteinput_focus_in (int client) { @@ -1157,6 +1162,11 @@ private: m_send_trans.put_command(ISM_TRANS_CMD_UPDATE_SELECTION); m_send_trans.put_data(text); m_send_trans.write_to_socket(client_socket); + + m_send_trans.clear(); + m_send_trans.put_command(SCIM_TRANS_CMD_REPLY); + m_send_trans.put_command(ISM_TRANS_CMD_FLUSH_BUFFER); + m_send_trans.write_to_socket(client_socket); } void socket_get_keyboard_ise_list(int client, uint32 context, const String& uuid, std::vector& list) { diff --git a/ism/src/isf_message_queue.h b/ism/src/isf_message_queue.h index 4cb0c44..90411cf 100644 --- a/ism/src/isf_message_queue.h +++ b/ism/src/isf_message_queue.h @@ -701,6 +701,11 @@ protected: uint32 m_keyboard_mode; }; +/* ISM_TRANS_CMD_FLUSH_BUFFER */ +class MessageItemFlushBuffer : public MessageItemHelper +{ +}; + template inline T* alloc_message() /* We could use memory pool in the future for performance enhancement */ @@ -1626,6 +1631,15 @@ public: } break; } + case ISM_TRANS_CMD_FLUSH_BUFFER: + { + MessageItemFlushBuffer *message = alloc_message(); + if (message) { + message->get_command_ref() = cmd; + m_list_messages.push_back(message); + } + break; + } } } diff --git a/ism/src/scim_trans_commands.h b/ism/src/scim_trans_commands.h index 416028e..24fa30e 100644 --- a/ism/src/scim_trans_commands.h +++ b/ism/src/scim_trans_commands.h @@ -708,6 +708,7 @@ const int ISM_TRANS_CMD_CANDIDATE_HIDE = 1257; const int ISM_TRANS_CMD_CHECK_OPTION_WINDOW = 1258; const int ISM_TRANS_CMD_TURN_ON_LOG = 1301; +const int ISM_TRANS_CMD_FLUSH_BUFFER = 1302; const int SCIM_TRANS_CMD_USER_DEFINED = 10000; /** -- 2.7.4