mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05:00
[terminal] Periodically refresh screen
DISPLAY_TIME_REFRESH 50ms (No more than 20fps). It is still using too much CPU for refreshing screen.
This commit is contained in:
parent
3b1c5ce751
commit
37cc5f52eb
@ -489,6 +489,15 @@ set_handlers(int fd, select_handler_T read_func, select_handler_T write_func,
|
||||
}
|
||||
}
|
||||
|
||||
static timer_id_T periodic_redraw_timer = TIMER_ID_UNDEF;
|
||||
|
||||
static void
|
||||
periodic_redraw_all_terminals(void *data)
|
||||
{
|
||||
redraw_all_terminals();
|
||||
install_timer(&periodic_redraw_timer, DISPLAY_TIME_REFRESH, periodic_redraw_all_terminals, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
select_loop(void (*init)(void))
|
||||
{
|
||||
@ -515,12 +524,12 @@ select_loop(void (*init)(void))
|
||||
}
|
||||
#endif
|
||||
if (event_enabled) {
|
||||
periodic_redraw_all_terminals(NULL);
|
||||
while (!program.terminate) {
|
||||
check_signals();
|
||||
if (1 /*(!F)*/) {
|
||||
do_event_loop(EVLOOP_NONBLOCK);
|
||||
check_signals();
|
||||
redraw_all_terminals();
|
||||
}
|
||||
if (program.terminate) break;
|
||||
do_event_loop(EVLOOP_ONCE);
|
||||
|
@ -61,6 +61,7 @@
|
||||
|
||||
#define DISPLAY_TIME_MIN ((milliseconds_T) 200)
|
||||
#define DISPLAY_TIME 20
|
||||
#define DISPLAY_TIME_REFRESH ((milliseconds_T) 50)
|
||||
|
||||
#define HTML_LEFT_MARGIN 3
|
||||
#define HTML_MAX_TABLE_LEVEL 10
|
||||
|
Loading…
x
Reference in New Issue
Block a user