From eb112f9cd7992bedae11d9b8f98b0c5d07ef3bc3 Mon Sep 17 00:00:00 2001 From: deepend Date: Tue, 17 Feb 2026 14:26:02 -0700 Subject: [PATCH] appended lines were scheduled with a timer (REFRESH_TIMEOUT * 2 where REFRESH_TIMEOUT is 20), which effectively adds ~40ms before draw in this path. I changed that specific path to render on the next idle cycle (g_idle_add) so locally echoed sent messages appear sooner. --- src/fe-gtk/xtext.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/fe-gtk/xtext.c b/src/fe-gtk/xtext.c index 3b7bc853..9f9d81d3 100644 --- a/src/fe-gtk/xtext.c +++ b/src/fe-gtk/xtext.c @@ -5426,10 +5426,11 @@ gtk_xtext_append_entry (xtext_buffer *buf, textentry * ent, time_t stamp) g_source_remove (buf->xtext->io_tag); buf->xtext->io_tag = 0; } - buf->xtext->add_io_tag = g_timeout_add (REFRESH_TIMEOUT * 2, - (GSourceFunc) - gtk_xtext_render_page_timeout, - buf->xtext); + /* 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); } } if (buf->scrollbar_down)