[hackers] [st] More stable blinking. || Christoph Lohmann
commit 8618386de947a1e2d0b449d6f60fde478e931ecb
Author: Christoph Lohmann <20h_AT_r-36.net>
Date: Wed May 1 13:14:46 2013 +0200
More stable blinking.
diff --git a/st.c b/st.c
index 5095315..533fb0a 100644
--- a/st.c
+++ b/st.c
_AT_@ -3496,8 +3496,15 @@ run(void) {
xev--;
if(!FD_ISSET(cmdfd, &rfd) && !FD_ISSET(xfd, &rfd)) {
if(blinkset) {
- drawtimeout.tv_usec = 1000 * \
- blinktimeout;
+ if(TIMEDIFF(now, lastblink) \
+ > blinktimeout) {
+ drawtimeout.tv_usec = 1;
+ } else {
+ drawtimeout.tv_usec = (1000 * \
+ (blinktimeout - \
+ TIMEDIFF(now,
+ lastblink)));
+ }
} else {
tv = NULL;
}
Received on Wed May 01 2013 - 13:17:09 CEST
This archive was generated by hypermail 2.3.0
: Wed May 01 2013 - 13:24:10 CEST