1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-06-30 22:16:44 +02:00

Allow ncurses refresh rate to be set dynamically

This allows us to have a higher refresh rate only when necessary (e.g. games)
This commit is contained in:
jfreegman
2021-11-20 09:49:04 -05:00
parent 1803da85c1
commit b7002ef3f0
5 changed files with 45 additions and 9 deletions

View File

@ -934,6 +934,26 @@ int get_num_active_windows(void)
return num_active_windows;
}
/* Returns the number of active windows of given type. */
size_t get_num_active_windows_type(WINDOW_TYPE type)
{
size_t count = 0;
for (size_t i = 0; i < MAX_WINDOWS_NUM; ++i) {
ToxWindow *w = windows[i];
if (w == NULL) {
continue;
}
if (w->type == type) {
++count;
}
}
return count;
}
/* destroys all chat and conference windows (should only be called on shutdown) */
void kill_all_windows(Tox *m)
{