diff options
author | Jesse Luehrs <doy@tozt.net> | 2016-05-08 17:23:27 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2016-05-08 17:23:27 -0400 |
commit | fff28b4c76a8ab44b578ccd1ccd62af473ead21c (patch) | |
tree | c454566a547127442cc47435e1091a80e0f82b24 /src/window-xlib.c | |
parent | 6e36dc64f465a8dcbaaa0ec84f57d4d0c193dae1 (diff) | |
download | runes-fff28b4c76a8ab44b578ccd1ccd62af473ead21c.tar.gz runes-fff28b4c76a8ab44b578ccd1ccd62af473ead21c.zip |
fix large refresh rates
Diffstat (limited to 'src/window-xlib.c')
-rw-r--r-- | src/window-xlib.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/window-xlib.c b/src/window-xlib.c index 6507f42..dc171cd 100644 --- a/src/window-xlib.c +++ b/src/window-xlib.c @@ -549,8 +549,12 @@ static int runes_window_backend_check_recent(RunesTerm *t) } clock_gettime(CLOCK_REALTIME, &now); + while (rate >= 1000) { + now.tv_sec -= 1; + rate -= 1000; + } now.tv_nsec -= rate * 1000000; - if (now.tv_nsec < 0) { + while (now.tv_nsec < 0) { now.tv_sec -= 1; now.tv_nsec += 1000000000; } |