From: root Date: Fri, 14 Dec 2007 05:25:23 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=3bd365ed7e5486244c64a3949765a46f3018c3fe;p=dana%2Furxvt.git *** empty log message *** --- diff --git a/src/command.C b/src/command.C index 705a4baf..684b1293 100644 --- a/src/command.C +++ b/src/command.C @@ -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; } diff --git a/src/init.C b/src/init.C index 436b9c57..e68ac1b0 100644 --- a/src/init.C +++ b/src/init.C @@ -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; diff --git a/src/main.C b/src/main.C index f7a89b9f..466484c9 100644 --- a/src/main.C +++ b/src/main.C @@ -187,7 +187,6 @@ rxvt_term::rxvt_term () bell_ev.set (this); #endif child_ev.set (this); - prepare_ev.set (this); flush_ev.set (this); destroy_ev.set (this); pty_ev.set (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 diff --git a/src/rxvt.h b/src/rxvt.h index a6c631e2..40079871 100644 --- a/src/rxvt.h +++ b/src/rxvt.h @@ -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 (); diff --git a/src/rxvtperl.xs b/src/rxvtperl.xs index 7657f032..31b87182 100644 --- a/src/rxvtperl.xs +++ b/src/rxvtperl.xs @@ -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 (); + } } } diff --git a/src/rxvttoolkit.C b/src/rxvttoolkit.C index e1df909c..666b0e2c 100644 --- a/src/rxvttoolkit.C +++ b/src/rxvttoolkit.C @@ -299,7 +299,8 @@ rxvt_display::rxvt_display (const char *id) : refcounted (id) , selection_owner (0) { - x_ev.set (this); + x_ev .set (this); + flush_ev.set (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) diff --git a/src/rxvttoolkit.h b/src/rxvttoolkit.h index 4bb32525..dd7d21dd 100644 --- a/src/rxvttoolkit.h +++ b/src/rxvttoolkit.h @@ -221,7 +221,8 @@ struct rxvt_display : refcounted { event_vec 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 xims; diff --git a/src/screen.C b/src/screen.C index 7a5e3bff..29bf32ce 100644 --- a/src/screen.C +++ b/src/screen.C @@ -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; +} /* ------------------------------------------------------------------------- */ /*