From 7d9bd457ec96876e30637d2ea68a8555dc20871d Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Tue, 6 Mar 2018 10:38:09 +0900 Subject: [PATCH] Prevent sending an unnecessary reshow request Change-Id: Icce2a8ac420ec2553328ec219f5d0c2d5ce90894 --- ism/src/isf_info_manager.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ism/src/isf_info_manager.cpp b/ism/src/isf_info_manager.cpp index c0e68b8..1143c4b 100644 --- a/ism/src/isf_info_manager.cpp +++ b/ism/src/isf_info_manager.cpp @@ -274,6 +274,7 @@ class InfoManager::InfoManagerImpl bool m_ise_exiting; bool m_is_imengine_aux; bool m_is_imengine_candidate; + bool m_reshow_needed; std::vector m_current_send_remoteinput_id; std::vector m_current_recv_remoteinput_id; @@ -415,6 +416,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_reshow_needed (false), 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")); @@ -1054,16 +1056,20 @@ public: if (it != m_helper_client_index.end ()) { Socket client_socket (it->second.id); m_panel_agent_manager.show_helper (it->second.id, ctx, uuid, data, len); + m_reshow_needed = false; return true; } LOGW ("Can't find %s", m_current_helper_uuid.c_str ()); + m_reshow_needed = true; + return false; } void hide_helper (const String& uuid, uint32 ctx = 0) { HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid); + m_reshow_needed = false; if (it != m_helper_client_index.end ()) { int client; uint32 context; @@ -2155,6 +2161,8 @@ public: } void reshow_input_panel () { + if (!m_reshow_needed) return; + /* Check whether application is already focus_in */ if (m_current_socket_client != -1) { LOGD ("Re-focus in"); -- 2.7.4