Browse Source

Merge remote-tracking branch 'origin/master' into omaster

Roberto E. Vargas Caballero 11 years ago
parent
commit
3d3c37bc70
1 changed files with 5 additions and 2 deletions
  1. 5 2
      st.c

+ 5 - 2
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;
 		}