X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=st.c;h=d0a62187528992b290fde1cbabfa4562eedb2dc0;hb=489982d4b8442af25a380f8c22be542055cda81f;hp=9df6707c1b7e4884eb57b96a720804b194db46fd;hpb=8e577322a3a55abf2f8226218ec87a7eec7fc3b1;p=st.git diff --git a/st.c b/st.c index 9df6707..d0a6218 100644 --- a/st.c +++ b/st.c @@ -256,9 +256,9 @@ typedef struct { } XWindow; typedef struct { - int b; + uint b; uint mask; - char s[ESC_BUF_SIZ]; + char *s; } Mousekey; typedef struct { @@ -3687,6 +3687,8 @@ run(void) { gettimeofday(&last, NULL); for(xev = actionfps;;) { + long deltatime; + FD_ZERO(&rfd); FD_SET(cmdfd, &rfd); FD_SET(xfd, &rfd); @@ -3720,8 +3722,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; }