*** empty log message ***
authorroot <root>
Fri, 14 Dec 2007 05:25:23 +0000 (05:25 +0000)
committerroot <root>
Fri, 14 Dec 2007 05:25:23 +0000 (05:25 +0000)
src/command.C
src/init.C
src/main.C
src/rxvt.h
src/rxvtperl.xs
src/rxvttoolkit.C
src/rxvttoolkit.h
src/screen.C

index 705a4ba..684b129 100644 (file)
@@ -1043,13 +1043,10 @@ rxvt_term::flush ()
   display->flush ();
 }
 
+/* checks wether a refresh is requested and starts the refresh timer */
 void
-rxvt_term::prepare_cb (ev::prepare &w, int revents)
+rxvt_term::refresh_check ()
 {
-  make_current ();
-
-  display->flush ();
-
   if (want_refresh && !flush_ev.is_active ())
     flush_ev.start (1. / 60.); // refresh at max. 60 Hz normally
 }
@@ -1069,6 +1066,7 @@ rxvt_term::cursor_blink_cb (ev::timer &w, int revents)
 {
   hidden_cursor = !hidden_cursor;
   want_refresh = 1;
+  refresh_check ();
 }
 #endif
 
@@ -1080,6 +1078,7 @@ rxvt_term::text_blink_cb (ev::timer &w, int revents)
     {
       hidden_text = !hidden_text;
       want_refresh = 1;
+  refresh_check ();
     }
   else
     w.stop ();
@@ -1092,7 +1091,10 @@ rxvt_term::cont_scroll_cb (ev::timer &w, int revents)
 {
   if ((scrollbar_isUp () || scrollbar_isDn ())
       && scr_page (scrollbar_isUp () ? UP : DN, 1))
-    want_refresh = 1;
+    {
+      want_refresh = 1;
+      refresh_check ();
+    }
   else
     w.stop ();
 }
@@ -1106,6 +1108,7 @@ rxvt_term::sel_scroll_cb (ev::timer &w, int revents)
     {
       selection_extend (selection_save_x, selection_save_y, selection_save_state);
       want_refresh = 1;
+      refresh_check ();
     }
   else
     w.stop ();
@@ -1117,7 +1120,10 @@ void
 rxvt_term::slip_wheel_cb (ev::timer &w, int revents)
 {
   if (scr_changeview (view_start - mouse_slip_wheel_speed))
-    want_refresh = 1;
+    {
+      want_refresh = 1;
+      refresh_check ();
+    }
 
   if (view_start == top_row || view_start == 0 || mouse_slip_wheel_speed == 0)
     {
@@ -1508,6 +1514,7 @@ rxvt_term::x_cb (XEvent &ev)
                 scr_expose (ev.xexpose.x, ev.xexpose.y,
                             ev.xexpose.width, ev.xexpose.height, False);
               }
+
             want_refresh = 1;
           }
         else
@@ -1664,6 +1671,8 @@ rxvt_term::x_cb (XEvent &ev)
         pointer_blank ();
     }
 #endif
+
+  refresh_check ();
 }
 
 void
@@ -1786,6 +1795,8 @@ rxvt_term::rootwin_cb (XEvent &ev)
         break;
     }
 # endif
+
+  refresh_check ();
 }
 #endif
 
@@ -2300,6 +2311,8 @@ rxvt_term::cmd_parse ()
         }
     }
 
+  refresh_check ();
+
   return flag;
 }
 
index 436b9c5..e68ac1b 100644 (file)
@@ -289,7 +289,6 @@ rxvt_term::init_vars ()
   pix_colors_unfocused = new rxvt_color [TOTAL_COLORS];
 #endif
 
-
   MEvent.time = CurrentTime;
   MEvent.button = AnyButton;
   want_refresh = 1;
index f7a89b9..466484c 100644 (file)
@@ -187,7 +187,6 @@ rxvt_term::rxvt_term ()
   bell_ev.set             <rxvt_term, &rxvt_term::bell_cb>    (this);
 #endif
   child_ev.set            <rxvt_term, &rxvt_term::child_cb>   (this);
-  prepare_ev.set          <rxvt_term, &rxvt_term::prepare_cb> (this);
   flush_ev.set            <rxvt_term, &rxvt_term::flush_cb>   (this);
   destroy_ev.set          <rxvt_term, &rxvt_term::destroy_cb> (this);
   pty_ev.set              <rxvt_term, &rxvt_term::pty_cb>     (this);
@@ -354,7 +353,7 @@ rxvt_term::destroy ()
       vt_ev.stop (display);
     }
 
-  prepare_ev.stop ();
+  flush_ev.stop ();
   pty_ev.stop ();
 #ifdef CURSOR_BLINK
   cursor_blink_ev.stop ();
@@ -572,8 +571,6 @@ rxvt_term::init (int argc, const char *const *argv, stringvec *envv)
   if (pty->pty >= 0)
     pty_ev.start (pty->pty, ev::READ);
 
-  prepare_ev.start ();
-
   HOOK_INVOKE ((this, HOOK_START, DT_END));
 
 #if ENABLE_XEMBED
index a6c631e..4007987 100644 (file)
@@ -1063,8 +1063,8 @@ struct rxvt_term : zero_initialized, rxvt_vars, rxvt_screen {
 #endif
 
   void child_cb (ev::child &w, int revents); ev::child child_ev;
-  void prepare_cb (ev::prepare &w, int revents); ev::prepare prepare_ev;
   void destroy_cb (ev::idle &w, int revents); ev::idle destroy_ev;
+  void refresh_check ();
   void flush ();
   void flush_cb (ev::timer &w, int revents); ev::timer flush_ev;
   bool pty_fill ();
index 7657f03..31b8718 100644 (file)
@@ -216,6 +216,7 @@ overlay::show ()
   av_push (overlay_av, newSViv ((long)this));
 
   THIS->want_refresh = 1;
+  THIS->refresh_check ();
 }
 
 void
@@ -239,6 +240,7 @@ overlay::hide ()
   overlay_av = 0;
 
   THIS->want_refresh = 1;
+  THIS->refresh_check ();
 }
 
 void overlay::swap ()
@@ -293,6 +295,7 @@ void overlay::set (int x, int y, SV *text, SV *rend)
     }
 
   THIS->want_refresh = 1;
+  THIS->refresh_check ();
 }
 
 /////////////////////////////////////////////////////////////////////////////
@@ -1226,6 +1229,7 @@ void
 rxvt_term::want_refresh ()
        CODE:
         THIS->want_refresh = 1;
+       THIS->refresh_check ();
 
 void
 rxvt_term::ROW_t (int row_number, SV *new_text = 0, int start_col = 0, int start_ofs = 0, int max_len = MAX_COLS)
@@ -1471,7 +1475,7 @@ rxvt_term::option (U8 optval, int set = -1)
           {
             THIS->set_option (optval, set);
 
-            if (THIS->prepare_ev.is_active ()) // avoid doing this before START
+            if (THIS->env_colorfgbg [0]) // avoid doing this before START
               switch (optval)
                 {
                   case Opt_skipBuiltinGlyphs:
@@ -1479,10 +1483,12 @@ rxvt_term::option (U8 optval, int set = -1)
                     THIS->scr_remap_chars ();
                     THIS->scr_touch (true);
                     THIS->want_refresh = 1;
+                    THIS->refresh_check ();
                     break;
 
                   case Opt_cursorUnderline:
                     THIS->want_refresh = 1;
+                    THIS->refresh_check ();
                     break;
 
 #                  case Opt_scrollBar_floating:
@@ -1550,7 +1556,10 @@ rxvt_term::screen_cur (...)
             clamp_it (rc.row, THIS->top_row, THIS->nrow - 1);
 
             if (ix)
-              THIS->want_refresh = 1;
+              {
+                THIS->want_refresh = 1;
+                THIS->refresh_check ();
+              }
           }
 }
 
index e1df909..666b0e2 100644 (file)
@@ -299,7 +299,8 @@ rxvt_display::rxvt_display (const char *id)
 : refcounted (id)
 , selection_owner (0)
 {
-  x_ev.set<rxvt_display, &rxvt_display::x_cb> (this);
+  x_ev    .set<rxvt_display, &rxvt_display::x_cb    > (this);
+  flush_ev.set<rxvt_display, &rxvt_display::flush_cb> (this);
 }
 
 XrmDatabase
@@ -473,6 +474,7 @@ bool rxvt_display::ref_init ()
   if (!getsockname (fd, (sockaddr *)&sa, &sl))
     is_local = sa.sun_family == AF_UNIX;
 
+  flush_ev.start ();
   x_ev.start (fd, ev::READ);
   fcntl (fd, F_SETFD, FD_CLOEXEC);
 
@@ -569,13 +571,16 @@ void rxvt_display::x_cb (ev::io &w, int revents)
         }
 #endif
     }
+}
 
+void rxvt_display::flush ()
+{
   XFlush (dpy);
 }
 
-void rxvt_display::flush ()
+void rxvt_display::flush_cb (ev::prepare &w, int revents)
 {
-  x_cb (x_ev, ev::READ);
+  flush ();
 }
 
 void rxvt_display::reg (xevent_watcher *w)
index 4bb3252..dd7d21d 100644 (file)
@@ -221,7 +221,8 @@ struct rxvt_display : refcounted
 {
   event_vec<xevent_watcher> xw;
 
-  ev::io x_ev; void x_cb (ev::io &w, int revents);
+  ev::prepare flush_ev; void flush_cb (ev::prepare &w, int revents);
+  ev::io      x_ev    ; void x_cb     (ev::io      &w, int revents);
 
 #ifdef USE_XIM
   refcache<rxvt_xim> xims;
index 7a5e3bf..29bf32c 100644 (file)
@@ -598,14 +598,14 @@ rxvt_term::scr_color (unsigned int color, int fgbg) NOTHROW
  */
 void
 rxvt_term::scr_rendition (int set, int style) NOTHROW
-  {
-    if (set)
-      rstyle |= style;
-    else if (style == ~RS_None)
-      rstyle = DEFAULT_RSTYLE;
-    else
-      rstyle &= ~style;
-  }
+{
+  if (set)
+    rstyle |= style;
+  else if (style == ~RS_None)
+    rstyle = DEFAULT_RSTYLE;
+  else
+    rstyle &= ~style;
+}
 
 /* ------------------------------------------------------------------------- */
 /*