diff --git a/src/fe-gtk/xtext.c b/src/fe-gtk/xtext.c index aff3b989..02e334d5 100644 --- a/src/fe-gtk/xtext.c +++ b/src/fe-gtk/xtext.c @@ -5426,11 +5426,16 @@ gtk_xtext_append_entry (xtext_buffer *buf, textentry * ent, time_t stamp) g_source_remove (buf->xtext->io_tag); buf->xtext->io_tag = 0; } - /* Render new lines as soon as the UI is idle to avoid a noticeable - * delay between pressing Enter and seeing your own message. */ - buf->xtext->add_io_tag = g_idle_add ((GSourceFunc) - gtk_xtext_render_page_timeout, - buf->xtext); + /* When at the bottom of the buffer, render immediately so long + * scrollback doesn't delay newly-sent messages appearing. + * Otherwise, keep idle batching to avoid extra redraws while + * scrolling around old content. */ + if (buf->scrollbar_down) + gtk_xtext_render_page_timeout (buf->xtext); + else + buf->xtext->add_io_tag = g_idle_add ((GSourceFunc) + gtk_xtext_render_page_timeout, + buf->xtext); } } if (buf->scrollbar_down)