diff options
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; } |