Simplify the event loop code

Also reduce input latency by ignoring repaint_delay when
there is actual pending input.

Gets rid of request_tick_callback(). Now empty events
result in the tick callback being called so there is only a
single mechanism for waking up the main loop and getting
the tick callback called.
This commit is contained in:
Kovid Goyal
2019-07-18 14:25:11 +05:30
parent 5521d6b623
commit 1cb15dedac
17 changed files with 95 additions and 82 deletions

View File

@@ -481,7 +481,8 @@ Delay (in milliseconds) between screen updates. Decreasing it, increases
frames-per-second (FPS) at the cost of more CPU usage. The default value
yields ~100 FPS which is more than sufficient for most uses. Note that to
actually achieve 100 FPS you have to either set :opt:`sync_to_monitor` to no
or use a monitor with a high refresh rate.'''))
or use a monitor with a high refresh rate. Also, to minimize latency
when there is pending input to be processed, repaint_delay is ignored.'''))
o('input_delay', 3, option_type=positive_int, long_text=_('''
Delay (in milliseconds) before input from the program running in the terminal