From fff28b4c76a8ab44b578ccd1ccd62af473ead21c Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 8 May 2016 17:23:27 -0400 Subject: fix large refresh rates --- src/window-xlib.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3-54-g00ecf