1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-03 12:16:44 +02:00

Greatly reduce redundant window refreshing

This should substantially reduce CPU usage and possibly fix some
issues with interface jittering/flashing
This commit is contained in:
jfreegman
2021-11-19 17:54:35 -05:00
parent 13337041ce
commit f3f81111c8
10 changed files with 134 additions and 21 deletions

View File

@ -444,6 +444,8 @@ int line_info_add(ToxWindow *self, bool show_timestamp, const char *name1, const
hst->queue[hst->queue_size++] = new_line;
flag_interface_refresh();
return new_line->id;
}
@ -469,6 +471,8 @@ static void line_info_check_queue(ToxWindow *self)
if (!self->scroll_pause) {
line_info_reset_start(self, hst);
}
flag_interface_refresh();
}
#define NOREAD_FLAG_TIMEOUT 5 /* seconds before a sent message with no read receipt is flagged as unread */
@ -750,6 +754,8 @@ static bool line_info_screen_fit(ToxWindow *self, struct line_info *line)
/* puts msg in specified line_info msg buffer */
void line_info_set(ToxWindow *self, uint32_t id, char *msg)
{
flag_interface_refresh();
struct line_info *line = self->chatwin->hst->line_end;
while (line) {
@ -855,6 +861,10 @@ bool line_info_onKey(ToxWindow *self, wint_t key)
match = false;
}
if (match) {
flag_interface_refresh();
}
return match;
}