Explorar o código

More stable blinking.

Christoph Lohmann %!s(int64=12) %!d(string=hai) anos
pai
achega
8618386de9
Modificáronse 1 ficheiros con 9 adicións e 2 borrados
  1. 9 2
      st.c

+ 9 - 2
st.c

@@ -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;
 				}