Fix logic to exit IME in I/O error 96/316896/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 06:50:13 +0000 (15:50 +0900)
Change-Id: I1f8ac4489aa632596d2c6da3719d1df57cddf701
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
src/sclconnection-isf.cpp
src/sclconnection-isf.h

index 0308d5703cf96b977fe3416ae6059322118481da..86014b45abd8a1ab2a8ac02d909adb5b6c012298 100644 (file)
@@ -799,9 +799,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");
             }
         }
     }
@@ -809,10 +807,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";
 }
@@ -946,6 +957,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;
         }
     }
@@ -958,6 +971,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 61e4742b36ca48b4864ce83e09cea0163de9165c..06a35ef083d3d33178852ae24e1b1f797263dff8 100644 (file)
@@ -109,6 +109,7 @@ private:
     scim::HelperAgent m_helper_agent;
 
     Ecore_Fd_Handler *m_fd_handler;
+    Ecore_Fd_Handler *m_fd_error_handler;
 };
 
 }