fix(ui): keep messages visible after scrolling in non-chat windows #123
@@ -301,12 +301,6 @@ cl_ev_send_ai_msg(ProfAiWin* aiwin, const char* const message, const char* const
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reset paged flag before printing user message.
|
|
||||||
* If the user scrolled up to view history, paged=1 would suppress
|
|
||||||
* the message in _win_printf(). Reset it here so the message displays. */
|
|
||||||
aiwin->window.layout->paged = 0;
|
|
||||||
aiwin->window.layout->unread_msg = 0;
|
|
||||||
|
|
||||||
// Display user message in AI window.
|
// Display user message in AI window.
|
||||||
win_print_outgoing(&aiwin->window, ">>", id, NULL, message);
|
win_print_outgoing(&aiwin->window, ">>", id, NULL, message);
|
||||||
|
|
||||||
|
|||||||
@@ -1809,11 +1809,16 @@ static void
|
|||||||
_win_printf(ProfWin* window, const char* show_char, int pad_indent, GDateTime* timestamp, int flags, theme_item_t theme_item, const char* const display_from, const char* const from_jid, const char* const message_id, const char* const message, ...)
|
_win_printf(ProfWin* window, const char* show_char, int pad_indent, GDateTime* timestamp, int flags, theme_item_t theme_item, const char* const display_from, const char* const from_jid, const char* const message_id, const char* const message, ...)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* Prevent printing and buffer update when user is viewing message history [SCROLLING]*/
|
/* While the user is scrolled, bump the unread indicator. Only WIN_CHAT
|
||||||
|
* skips the buffer/render entirely — it can recover the message via
|
||||||
|
* chatwin_db_history on scroll-down. Other window types have no DB
|
||||||
|
* fallback, so the message must still be appended to the buffer and pad. */
|
||||||
if (window->layout->paged && wins_is_current(window)) {
|
if (window->layout->paged && wins_is_current(window)) {
|
||||||
window->layout->unread_msg++;
|
window->layout->unread_msg++;
|
||||||
|
if (window->type == WIN_CHAT) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (timestamp == NULL) {
|
if (timestamp == NULL) {
|
||||||
timestamp = g_date_time_new_now_local();
|
timestamp = g_date_time_new_now_local();
|
||||||
|
|||||||
Reference in New Issue
Block a user