1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-12-07 02:16:35 +01: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

@@ -174,6 +174,10 @@ void game_kill(ToxWindow *self)
kill_notifs(self->active_box);
del_window(self);
if (get_num_active_windows_type(WINDOW_TYPE_GAME) == 0) {
set_window_refresh_rate(NCURSES_DEFAULT_REFRESH_RATE);
}
}
static void game_init_abort(const ToxWindow *parent, ToxWindow *self)
@@ -300,6 +304,8 @@ int game_initialize(const ToxWindow *parent, Tox *m, GameType type, uint32_t id,
set_active_window_index(window_id);
set_window_refresh_rate(NCURSES_GAME_REFRESH_RATE);
return 0;
}