Fix logic to exit IME in I/O error 21/316921/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Thu, 19 Dec 2024 06:50:13 +0000 (15:50 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Thu, 19 Dec 2024 09:22:20 +0000 (18:22 +0900)
Change-Id: I1f8ac4489aa632596d2c6da3719d1df57cddf701
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
src/sclconnection-isf.cpp
src/sclconnection-isf.h

index 2e62e2891cd29082a9ecf63aaf0a6d460a2c7531..8aa05c107d7406fa5afc6b428be702441e966472 100644 (file)
@@ -789,9 +789,7 @@ Eina_Bool input_handler(void *data, Ecore_Fd_Handler *fd_handler)
                     elm_exit();
                 }
             } else {
-                LOGD("helper_agent.has_pending_event() failed!!!\n");
-                impl->fini();
-                elm_exit();
+                LOGE("helper_agent.has_pending_event() failed!!!\n");
             }
         }
     }
@@ -799,10 +797,23 @@ Eina_Bool input_handler(void *data, Ecore_Fd_Handler *fd_handler)
     return ECORE_CALLBACK_RENEW;
 }
 
+Eina_Bool input_error_handler(void *data, Ecore_Fd_Handler *fd_handler)
+{
+    LOGE("I/O Error!!\n");
+    CSCLCoreImpl *impl = CSCLCoreImpl::get_instance();
+    if (impl) {
+        impl->fini();
+        elm_exit();
+    }
+
+    return ECORE_CALLBACK_CANCEL;
+}
+
 CSCLConnectionISF::CSCLConnectionISF()
 {
     m_initialized = FALSE;
     m_fd_handler = NULL;
+    m_fd_error_handler = NULL;
 
     m_backend_identifier = "ISF";
 }
@@ -935,6 +946,8 @@ void CSCLConnectionISF::open_connection(const sclchar *display)
 #endif
 
             m_fd_handler = ecore_main_fd_handler_add(fd, ECORE_FD_READ, input_handler, &m_helper_agent, NULL, NULL);
+            m_fd_error_handler = ecore_main_fd_handler_add(fd, ECORE_FD_ERROR, input_error_handler, &m_helper_agent, NULL, NULL);
+
             g_need_exit = TRUE;
         }
     }
@@ -947,6 +960,10 @@ void CSCLConnectionISF::close_connection()
             ecore_main_fd_handler_del(m_fd_handler);
             m_fd_handler = NULL;
         }
+        if (m_fd_error_handler) {
+            ecore_main_fd_handler_del(m_fd_error_handler);
+            m_fd_error_handler = NULL;
+        }
         m_helper_agent.update_ise_exit();
         m_helper_agent.close_connection();
     }
index 1d1f84703bf91786fc426ba39b4751eed3cb4bc5..7ab2cd2c22e5c7df94a62300807a6d7e8ee4c8a3 100644 (file)
@@ -108,6 +108,7 @@ private:
     scim::HelperAgent m_helper_agent;
 
     Ecore_Fd_Handler *m_fd_handler;
+    Ecore_Fd_Handler *m_fd_error_handler;
 };
 
 }