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,11 +5426,16 @@ gtk_xtext_append_entry (xtext_buffer *buf, textentry * ent, time_t stamp)
|
|||||||
g_source_remove (buf->xtext->io_tag);
|
g_source_remove (buf->xtext->io_tag);
|
||||||
buf->xtext->io_tag = 0;
|
buf->xtext->io_tag = 0;
|
||||||
}
|
}
|
||||||
/* Render new lines as soon as the UI is idle to avoid a noticeable
|
/* When at the bottom of the buffer, render immediately so long
|
||||||
* delay between pressing Enter and seeing your own message. */
|
* scrollback doesn't delay newly-sent messages appearing.
|
||||||
buf->xtext->add_io_tag = g_idle_add ((GSourceFunc)
|
* Otherwise, keep idle batching to avoid extra redraws while
|
||||||
gtk_xtext_render_page_timeout,
|
* scrolling around old content. */
|
||||||
buf->xtext);
|
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)
|
if (buf->scrollbar_down)
|
||||||
|
|||||||
Reference in New Issue
Block a user