diff options
author | Roberto E. Vargas Caballero <k0ga@shike2.com> | 2012-09-16 10:48:38 +0200 |
---|---|---|
committer | Roberto E. Vargas Caballero <k0ga@shike2.com> | 2012-09-16 10:48:38 +0200 |
commit | c624bb570317bd93dadc8f9914e013ef94e27156 (patch) | |
tree | 327a0f3e907db5dee0c7a678c5c701bc202e59fe /LEGACY | |
parent | f3704e65537f0e86b9bcfbe998e6a82a1a59e611 (diff) | |
download | st-c624bb570317bd93dadc8f9914e013ef94e27156.tar.gz st-c624bb570317bd93dadc8f9914e013ef94e27156.tar.bz2 |
Render only once in each main loop iteration
draw() runs over all lines of the screen and renders only the dirty lines,
this avoids render lines which are not modified since last draw() call. In
this moment the main loop is something like:
- Wait something to read from file descriptors
- Read from pseudo tty
- Call draw() for rending
- Read X events
This cause the problem that all the X events that have to update the screen
have to call draw() (because draw() is called before of X events handling),
so you can have multiples renderings in only one iteration, that will waste
a lot of resources.
This patch change the main loop to:
- Wait something to read from file descriptors
- Read from pseudo tty
- Read X events
- Call draw() for rending
So X events don't have to worry about rendering, because draw() is called
after them.
The only place where draw is called outside of the main loop is in redraw(),
but it is necessary for getting a good tput flash.
---
st.c | 29 ++++++-----------------------
1 file changed, 6 insertions(+), 23 deletions(-)
Diffstat (limited to 'LEGACY')
0 files changed, 0 insertions, 0 deletions