aboutsummaryrefslogtreecommitdiffstats
path: root/src/window-xlib.c
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2016-05-08 17:23:27 -0400
committerJesse Luehrs <doy@tozt.net>2016-05-08 17:23:27 -0400
commitfff28b4c76a8ab44b578ccd1ccd62af473ead21c (patch)
treec454566a547127442cc47435e1091a80e0f82b24 /src/window-xlib.c
parent6e36dc64f465a8dcbaaa0ec84f57d4d0c193dae1 (diff)
downloadrunes-fff28b4c76a8ab44b578ccd1ccd62af473ead21c.tar.gz
runes-fff28b4c76a8ab44b578ccd1ccd62af473ead21c.zip
fix large refresh rates
Diffstat (limited to 'src/window-xlib.c')
-rw-r--r--src/window-xlib.c6
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;
}