mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-10 07:50:19 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user