1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-06-29 14:56:44 +02:00

fix chat scroll bug

This commit is contained in:
Jfreegman
2014-06-01 03:38:20 -04:00
parent ab1c97fb2b
commit d65d0a08aa
3 changed files with 24 additions and 2 deletions

View File

@ -417,7 +417,7 @@ void draw_active_window(Tox *m)
ltr = isprint(ch);
#endif
if (!ltr && (ch == T_KEY_NEXT || ch == T_KEY_PREV) ) {
if (!ltr && (ch == T_KEY_NEXT || ch == T_KEY_PREV)) {
set_next_window((int) ch);
} else {
pthread_mutex_lock(&Winthread.lock);
@ -426,6 +426,22 @@ void draw_active_window(Tox *m)
}
}
/* refresh inactive windows to prevent scrolling bugs.
call at least once per second */
void refresh_inactive_windows(void)
{
int i;
for (i = 0; i < MAX_WINDOWS_NUM; ++i) {
ToxWindow *a = &windows[i];
if (!a->active || a == active_window || a->is_prompt) /* if prompt doesn't have scroll mode */
continue;
line_info_print(a);
}
}
int get_num_active_windows(void)
{
return num_active_windows;