JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Merge remote-tracking branch 'origin/master' into omaster
authorRoberto E. Vargas Caballero <k0ga@shike2.com>
Mon, 28 Oct 2013 18:18:24 +0000 (19:18 +0100)
committerRoberto E. Vargas Caballero <k0ga@shike2.com>
Mon, 28 Oct 2013 18:18:24 +0000 (19:18 +0100)
1  2 
st.c

diff --combined st.c
--- 1/st.c
--- 2/st.c
+++ b/st.c
@@@ -3579,6 -3579,7 +3579,6 @@@ kpress(XEvent *ev) 
                return;
  
        len = XmbLookupString(xw.xic, e, buf, sizeof buf, &ksym, &status);
 -      e->state &= ~Mod2Mask;
        /* 1. shortcuts */
        for(bp = shortcuts; bp < shortcuts + LEN(shortcuts); bp++) {
                if(ksym == bp->keysym && match(bp->mod, e->state)) {
@@@ -3686,6 -3687,8 +3686,8 @@@ run(void) 
        gettimeofday(&last, NULL);
  
        for(xev = actionfps;;) {
+               long deltatime;
                FD_ZERO(&rfd);
                FD_SET(cmdfd, &rfd);
                FD_SET(xfd, &rfd);
                        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;
                }