*** empty log message ***
authorpcg <pcg>
Sat, 29 Nov 2003 18:42:07 +0000 (18:42 +0000)
committerpcg <pcg>
Sat, 29 Nov 2003 18:42:07 +0000 (18:42 +0000)
src/defaultfont.C
src/iom.C
src/iom.h
src/rxvtc.C

index 9db368212b54f3b1133f9060afd1116301a88f9b..572e3e6ad10280fc8b4d12704b0c26c7c5a697cf 100644 (file)
@@ -272,14 +272,11 @@ rxvt_font_default::draw (int x, int y,
         {
           const char *p = linedraw_cmds[t - 0x2500];
 
-          int x0 = x, x1 = x + (r->TermWin.fwidth  - 1) / 2, x2 = x + r->TermWin.fwidth  - 1;
-          int y0 = y, y1 = y + (r->TermWin.fheight - 1) / 2, y2 = y + r->TermWin.fheight - 1;
+          int x0 = x, x1 = x + r->TermWin.fwidth  / 2, x2 = x + r->TermWin.fwidth ;
+          int y0 = y, y1 = y + r->TermWin.fheight / 2, y2 = y + r->TermWin.fheight;
 
           XGCValues gcv;
 
-          gcv.cap_style = CapButt;
-          XChangeGC (DISPLAY, GC, GCCapStyle, &gcv);
-
           while (*p)
             {
               switch (*p++)
index 3b2e86af5a0d1d6da8069ad4690b98def19604fd..e9a12c34e401c2efb0633f54814a054b4ed72d0d 100644 (file)
--- a/src/iom.C
+++ b/src/iom.C
@@ -131,10 +131,13 @@ void io_manager::loop ()
         cw[i]->call (*cw[i]);
 #endif
 
+      struct timeval *to = 0;
+
 #if IOM_TIME
+      struct timeval tval;
       time_watcher *w;
 
-      for (;;)
+      for (;tw.size ();)
         {
           w = tw[0];
 
@@ -143,19 +146,18 @@ void io_manager::loop ()
               w = *i;
 
           if (w->at > NOW)
-            break;
-
-          // call it
-          w->call (*w);
-
-          if (w->at < 0)
+            {
+              double diff = w->at - NOW;
+              tval.tv_sec  = (int)diff;
+              tval.tv_usec = (int)((diff - tval.tv_sec) * 1000000);
+              to = &tval;
+              break;
+            }
+          else if (w->at >= 0)
+            w->call (*w);
+          else
             unreg (w);
         }
-
-      double diff = w->at - NOW;
-      struct timeval to;
-      to.tv_sec  = (int)diff;
-      to.tv_usec = (int)((diff - to.tv_sec) * 1000000);
 #endif
 
 #if IOM_IO
@@ -171,14 +173,15 @@ void io_manager::loop ()
           if ((*w)->events & EVENT_READ ) FD_SET ((*w)->fd, &rfd);
           if ((*w)->events & EVENT_WRITE) FD_SET ((*w)->fd, &wfd);
 
-          if ((*w)->fd > fds) fds = (*w)->fd;
+          if ((*w)->fd >= fds) fds = (*w)->fd + 1;
         }
 
+      if (!to && !fds)
+        break; // no events
+
+      fds = select (fds, &rfd, &wfd, 0, to);
 # if IOM_TIME
-      fds = select (fds + 1, &rfd, &wfd, 0, &to);
       set_now ();
-# else
-      fds = select (fds + 1, &rfd, &wfd, 0, 0);
 # endif
 
       if (fds > 0)
@@ -194,28 +197,25 @@ void io_manager::loop ()
             if (revents)
               w->call (*w, revents);
           }
-    }
 #elif IOM_TIME
+      if (!to)
+        break;
+
       select (0, 0, 0, 0, &to);
       set_now ();
+#else
+      break;
 #endif
-}
-
-void io_manager::idle_cb (time_watcher &w)
-{
-  w.at = NOW + 1000000000;
+    }
 }
 
 io_manager::io_manager ()
 {
+#if IOM_TIME
   set_now ();
+#endif
 
   iom_valid = true;
-
-#if IOM_TIME
-  idle = new time_watcher (this, &io_manager::idle_cb);
-  idle->start (0);
-#endif
 }
 
 io_manager::~io_manager ()
index ec381a80a57038e4a4224fc395212a59865c547e..3d461a764f5155c7e75fe31f347bab90e21806a4 100644 (file)
--- a/src/iom.h
+++ b/src/iom.h
@@ -51,8 +51,6 @@ class io_manager {
 #endif
 #if IOM_TIME
   simplevec<time_watcher *>  tw;
-
-  void idle_cb (time_watcher &w); time_watcher *idle;
 #endif
 
   template<class watcher>
index dedda71b0d6ef471c42bcaa571dc4ea0f7730806..0c0261c8ff30f611b30da1ba8c2e12d2b88c681b 100644 (file)
@@ -16,7 +16,7 @@ client::client ()
 {
   if ((fd = socket (PF_LOCAL, SOCK_STREAM, 0)) < 0)
     {
-      perror ("unable to create listening socket");
+      perror ("unable to create communications socket");
       exit (EXIT_FAILURE);
     }
 
@@ -28,7 +28,7 @@ client::client ()
 
   if (connect (fd, (sockaddr *)&sa, sizeof (sa)))
     {
-      perror ("unable to bind listening socket");
+      perror ("unable to connect to rxvtd");
       exit (EXIT_FAILURE);
     }
 }