This patch hopefully solves a bug that causes that when a tab (channel or private) is left with the scrollbar at the bottom, and some new text arrives, and then we select again that tab, sometimes the scrollbar is not completely down and there is hidden text and we have to scroll manually to the bottom to show all text.

This was previously submitted as an issue in: https://github.com/hexchat/hexchat/issues/1948
Maybe it isn't the ideal way to solve it, but at least I tested it and it seems to work.
This commit is contained in:
Rodri 2017-02-11 16:44:50 +01:00 committed by TingPing
parent ee8926503c
commit 4a228d1efe

View File

@ -4964,6 +4964,14 @@ gtk_xtext_buffer_show (GtkXText *xtext, xtext_buffer *buf, int render)
dontscroll (buf); /* force scrolling off */ dontscroll (buf); /* force scrolling off */
xtext->adj->value = buf->old_value; xtext->adj->value = buf->old_value;
xtext->adj->upper = buf->num_lines; xtext->adj->upper = buf->num_lines;
/* if the scrollbar was down, keep it down */
if (xtext->buffer->scrollbar_down && xtext->adj->value <
xtext->adj->upper - xtext->adj->page_size)
{
xtext->adj->value = xtext->adj->upper - xtext->adj->page_size;
}
if (xtext->adj->upper == 0) if (xtext->adj->upper == 0)
xtext->adj->upper = 1; xtext->adj->upper = 1;
/* sanity check */ /* sanity check */