diff options
author | Christoph Lohmann <20h@r-36.net> | 2013-05-01 13:14:46 +0200 |
---|---|---|
committer | Christoph Lohmann <20h@r-36.net> | 2013-05-01 13:14:46 +0200 |
commit | 8618386de947a1e2d0b449d6f60fde478e931ecb (patch) | |
tree | d2541bf11bd4d82601a30563057adab44a24f2e3 /st.c | |
parent | e1458ef467f1164fa3ca51e64e3c768c8c69b346 (diff) | |
download | st-8618386de947a1e2d0b449d6f60fde478e931ecb.tar.gz st-8618386de947a1e2d0b449d6f60fde478e931ecb.tar.bz2 st-8618386de947a1e2d0b449d6f60fde478e931ecb.zip |
More stable blinking.
Diffstat (limited to 'st.c')
-rw-r--r-- | st.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -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; } |