[hackers] [st] Monotonic clock cannot jump backwards. || noname_AT_inventati.org

From: <git_AT_suckless.org>
Date: Mon, 20 Apr 2015 09:36:05 +0200 (CEST)

commit c27c731b9f77c1b1c99f3bde737be53996809fcb
Author: noname_AT_inventati.org <noname_AT_inventati.org>
Date: Sat Apr 18 18:46:17 2015 +0200

    Monotonic clock cannot jump backwards.
    
    The check was introduced back when st used gettimeofday.
    The condition is also modified to increment the accuaracy of the
    calculation.

diff --git a/st.c b/st.c
index bf5b675..c7589f4 100644
--- a/st.c
+++ b/st.c
_AT_@ -4003,8 +4003,7 @@ run(void) {
                         dodraw = 1;
                 }
                 deltatime = TIMEDIFF(now, last);
- if(deltatime > (xev? (1000/xfps) : (1000/actionfps))
- || deltatime < 0) {
+ if(deltatime > 1000 / (xev ? xfps : actionfps)) {
                         dodraw = 1;
                         last = now;
                 }
Received on Mon Apr 20 2015 - 09:36:05 CEST

This archive was generated by hypermail 2.3.0 : Mon Apr 20 2015 - 09:36:43 CEST