*** empty log message ***
authorpcg <pcg>
Thu, 12 Feb 2004 01:42:03 +0000 (01:42 +0000)
committerpcg <pcg>
Thu, 12 Feb 2004 01:42:03 +0000 (01:42 +0000)
src/command.C
src/rxvtcolor.C
src/rxvtcolor.h

index a8c900a1fdfeaf17fc37371a076a2d835269e322..1149fff2f5238a97cc07cc40c187a71a8595ee73 100644 (file)
@@ -755,7 +755,7 @@ rxvt_term::flush ()
 
     }
 
-  XFlush (display->display);
+  display->flush ();
 }
 
 void
index 27f25105e674e34ef48506872e2c01d7dba6a58e..edd381ecb1318d2e6aa6b83e77b3206e3ec6d1b9 100644 (file)
@@ -104,7 +104,7 @@ rxvt_xim::~rxvt_xim ()
 
 rxvt_display::rxvt_display (const char *id)
 : refcounted (id)
-, x_watcher (this, &rxvt_display::x_event)
+, x_ev (this, &rxvt_display::x_cb)
 , selection_owner (0)
 {
 }
@@ -139,18 +139,20 @@ bool rxvt_display::init ()
 #endif
 
   int fd = XConnectionNumber (display);
-  x_watcher.start (fd, EVENT_READ);
+  x_ev.start (fd, EVENT_READ);
   fcntl (fd, F_SETFL, FD_CLOEXEC);
 
   XSelectInput (display, root, PropertyChangeMask);
   xa_xim_servers = XInternAtom (display, "XIM_SERVERS", 0);
 
+  flush ();
+
   return true;
 }
 
 rxvt_display::~rxvt_display ()
 {
-  x_watcher.stop ();
+  x_ev.stop ();
 
   XCloseDisplay (display);
 }
@@ -161,7 +163,7 @@ void rxvt_display::im_change_cb ()
     (*i)->call ();
 }
 
-void rxvt_display::x_event (io_watcher &w, short revents)
+void rxvt_display::x_cb (io_watcher &w, short revents)
 {
   do
     {
@@ -184,6 +186,21 @@ void rxvt_display::x_event (io_watcher &w, short revents)
         }
     }
   while (XPending (display));
+
+  flush ();
+}
+
+void rxvt_display::flush ()
+{
+  for (;;)
+    {
+      XFlush (display);
+
+      if (!XPending (display))
+        break;
+
+      x_cb (x_ev, 0);
+    }
 }
 
 void rxvt_display::reg (xevent_watcher *w)
index 80c3ccad23ab91ba890f7d1ca6bc689e5c7760c4..d811a27a592ac92aa4deba52112a1a98f0496886 100644 (file)
@@ -56,7 +56,7 @@ struct rxvt_display : refcounted {
   
   io_manager_vec<xevent_watcher> xw;
 
-  io_watcher x_watcher; void x_event (io_watcher &w, short revents);
+  io_watcher x_ev; void x_cb (io_watcher &w, short revents);
 
   refcache<rxvt_xim> xims;
   vector<im_watcher *> imw;
@@ -75,6 +75,8 @@ struct rxvt_display : refcounted {
   bool init ();
   ~rxvt_display ();
 
+  void flush ();
+
   void reg (xevent_watcher *w);
   void unreg (xevent_watcher *w);
   void reg (im_watcher *w);