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
}
{
hidden_cursor = !hidden_cursor;
want_refresh = 1;
+ refresh_check ();
}
#endif
{
hidden_text = !hidden_text;
want_refresh = 1;
+ refresh_check ();
}
else
w.stop ();
{
if ((scrollbar_isUp () || scrollbar_isDn ())
&& scr_page (scrollbar_isUp () ? UP : DN, 1))
- want_refresh = 1;
+ {
+ want_refresh = 1;
+ refresh_check ();
+ }
else
w.stop ();
}
{
selection_extend (selection_save_x, selection_save_y, selection_save_state);
want_refresh = 1;
+ refresh_check ();
}
else
w.stop ();
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)
{
scr_expose (ev.xexpose.x, ev.xexpose.y,
ev.xexpose.width, ev.xexpose.height, False);
}
+
want_refresh = 1;
}
else
pointer_blank ();
}
#endif
+
+ refresh_check ();
}
void
break;
}
# endif
+
+ refresh_check ();
}
#endif
}
}
+ refresh_check ();
+
return flag;
}
pix_colors_unfocused = new rxvt_color [TOTAL_COLORS];
#endif
-
MEvent.time = CurrentTime;
MEvent.button = AnyButton;
want_refresh = 1;
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);
vt_ev.stop (display);
}
- prepare_ev.stop ();
+ flush_ev.stop ();
pty_ev.stop ();
#ifdef CURSOR_BLINK
cursor_blink_ev.stop ();
if (pty->pty >= 0)
pty_ev.start (pty->pty, ev::READ);
- prepare_ev.start ();
-
HOOK_INVOKE ((this, HOOK_START, DT_END));
#if ENABLE_XEMBED
#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 ();
av_push (overlay_av, newSViv ((long)this));
THIS->want_refresh = 1;
+ THIS->refresh_check ();
}
void
overlay_av = 0;
THIS->want_refresh = 1;
+ THIS->refresh_check ();
}
void overlay::swap ()
}
THIS->want_refresh = 1;
+ THIS->refresh_check ();
}
/////////////////////////////////////////////////////////////////////////////
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)
{
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:
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:
clamp_it (rc.row, THIS->top_row, THIS->nrow - 1);
if (ix)
- THIS->want_refresh = 1;
+ {
+ THIS->want_refresh = 1;
+ THIS->refresh_check ();
+ }
}
}
: 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
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);
}
#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)
{
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;
*/
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;
+}
/* ------------------------------------------------------------------------- */
/*