Prevent sending an unnecessary reshow request 72/171572/2
authorJi-hoon Lee <dalton.lee@samsung.com>
Tue, 6 Mar 2018 01:38:09 +0000 (10:38 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Tue, 6 Mar 2018 01:51:15 +0000 (10:51 +0900)
Change-Id: Icce2a8ac420ec2553328ec219f5d0c2d5ce90894

ism/src/isf_info_manager.cpp

index c0e68b8..1143c4b 100644 (file)
@@ -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<int>                    m_current_send_remoteinput_id;
     std::vector<int>                    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");