mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-23 04:23:02 +01:00
reduce inactive window refresh rate
This commit is contained in:
parent
a784fdf9d5
commit
1575a40d61
@ -467,18 +467,23 @@ static void do_toxic(Tox *m, ToxWindow *prompt)
|
|||||||
tox_do(m); /* main tox-core loop */
|
tox_do(m); /* main tox-core loop */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define INACTIVE_WIN_REFRESH_RATE 10
|
||||||
|
|
||||||
void *thread_winref(void *data)
|
void *thread_winref(void *data)
|
||||||
{
|
{
|
||||||
Tox *m = (Tox *) data;
|
Tox *m = (Tox *) data;
|
||||||
|
uint8_t draw_count = 0;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
draw_active_window(m);
|
draw_active_window(m);
|
||||||
|
draw_count++;
|
||||||
|
|
||||||
if (Winthread.flag_resize) {
|
if (Winthread.flag_resize) {
|
||||||
on_window_resize();
|
on_window_resize();
|
||||||
Winthread.flag_resize = false;
|
Winthread.flag_resize = false;
|
||||||
} else {
|
} else if (draw_count >= INACTIVE_WIN_REFRESH_RATE) {
|
||||||
refresh_inactive_windows();
|
refresh_inactive_windows();
|
||||||
|
draw_count = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user