aboutsummaryrefslogtreecommitdiffstats
path: root/src/window-xlib.c
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2016-05-08 18:07:37 -0400
committerJesse Luehrs <doy@tozt.net>2016-05-08 18:07:37 -0400
commitc64efa947ca2cf63c294dba4245fe14048f66adf (patch)
tree1290ad19a9b0c9bfd2b92685850bc31a7180e95d /src/window-xlib.c
parent252b3d0474e68feea9d805a0f120dcdbf8f0a7b1 (diff)
downloadrunes-c64efa947ca2cf63c294dba4245fe14048f66adf.tar.gz
runes-c64efa947ca2cf63c294dba4245fe14048f66adf.zip
avoid some more work (and syscalls) when delaying redraws
Diffstat (limited to 'src/window-xlib.c')
-rw-r--r--src/window-xlib.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/window-xlib.c b/src/window-xlib.c
index f12fb7e..68930d2 100644
--- a/src/window-xlib.c
+++ b/src/window-xlib.c
@@ -550,6 +550,10 @@ static int runes_window_backend_check_recent(RunesTerm *t)
return 0;
}
+ if (w->delaying) {
+ return 1;
+ }
+
clock_gettime(CLOCK_REALTIME, &now);
while (rate >= 1000) {
now.tv_sec -= 1;
@@ -561,11 +565,9 @@ static int runes_window_backend_check_recent(RunesTerm *t)
now.tv_nsec += 1000000000;
}
if (now.tv_sec < w->last_redraw.tv_sec || (now.tv_sec == w->last_redraw.tv_sec && now.tv_nsec < w->last_redraw.tv_nsec)) {
- if (!w->delaying) {
- runes_loop_timer_set(
- t->loop, rate, 0, t, runes_window_backend_delay_cb);
- w->delaying = 1;
- }
+ runes_loop_timer_set(
+ t->loop, rate, 0, t, runes_window_backend_delay_cb);
+ w->delaying = 1;
return 1;
}
else {