[SCIM] Re: mlterm will freeze if I switch scim-m17n engines

Seiichi SATO ssato@sh.rim.or.jp
Sun Jan 9 02:31:50 PST 2005


On Wed, Jan 05, 2005 at 12:59:47AM +0900,
 UTUMI Hirosi wrote:

> SATO-san, Minami-san, what do you think about it?

I think that the problem happens in the event dispatcher
in scim_x11_frontend.cpp.
Could anybody try the attached patch?

--
Seiichi

-------------- next part --------------
--- modules/FrontEnd/scim_x11_frontend.cpp.orig
+++ modules/FrontEnd/scim_x11_frontend.cpp
@@ -436,9 +436,14 @@
 
     // Select between the X Server and the Panel GUI.
     while (!m_should_exit) {
+        struct timeval tval;
+        int ret;
+
         read_fds = active_fds;
+        tval.tv_usec = 500000;
+        tval.tv_sec = 0;
 
-        if (select (max_fd + 1, &read_fds, NULL, NULL, NULL) < 0) {
+        if ((ret = select (max_fd + 1, &read_fds, NULL, NULL, &tval)) < 0) {
             SCIM_DEBUG_FRONTEND(1) << "X11 -- Error when watching events!\n";
             return;
         }
@@ -462,7 +467,7 @@
             }
         }
 
-        if (FD_ISSET (xserver_fd, &read_fds)) {
+        if (FD_ISSET (xserver_fd, &read_fds) || ret == 0) {
             while (XPending (m_display)) {
                 XNextEvent (m_display, &event);
                 XFilterEvent (&event, None);


More information about the scim mailing list