Identified and fixed an obvious UI-path delay in message rendering: when a new line is appended and the user is already at the bottom of the channel buffer (scrollbar_down), the code now renders immediately instead of always waiting for an idle callback. This removes the subtle “sent but appears a moment later” effect in large-scrollback channels.

Preserved the previous idle-batched behavior for users who are not at the bottom (scrolling history), so performance-friendly deferred redraws still apply in that case.
This commit is contained in:
2026-02-17 14:49:15 -07:00
parent 97cbe98b3d
commit ae50735311

View File

@@ -5426,8 +5426,13 @@ 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. */
/* 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);