X-Git-Url: https://jasonwoof.com/gitweb/?p=st.git;a=blobdiff_plain;f=st.c;h=8cfa2f7ba40a0dcd4325706860c383c07315e0e9;hp=12e1e1f1e5ca4b799d3655f3e24094e9c675c0cb;hb=3d3c37bc70042cd2f4bbc8f6ea5fceb2311f0a32;hpb=297c886b72f4e9093973aaa14b66d392f6196634 diff --git a/st.c b/st.c index 12e1e1f..8cfa2f7 100644 --- a/st.c +++ b/st.c @@ -3686,6 +3686,8 @@ run(void) { gettimeofday(&last, NULL); for(xev = actionfps;;) { + long deltatime; + FD_ZERO(&rfd); FD_SET(cmdfd, &rfd); FD_SET(xfd, &rfd); @@ -3719,8 +3721,9 @@ run(void) { gettimeofday(&lastblink, NULL); dodraw = 1; } - if(TIMEDIFF(now, last) \ - > (xev? (1000/xfps) : (1000/actionfps))) { + deltatime = TIMEDIFF(now, last); + if(deltatime > (xev? (1000/xfps) : (1000/actionfps)) + || deltatime < 0) { dodraw = 1; last = now; }