diff --git a/examples/cluster.c b/examples/cluster.c index 434f297..52e9b7c 100644 --- a/examples/cluster.c +++ b/examples/cluster.c @@ -124,13 +124,9 @@ int main(int argc, char **argv) { FD_SET(fd2, &rfds); while (1) { - struct timeval now; - int pending, nfds = fd2 + 1; - (void)gettimeofday(&now, NULL); - while ((pending = XPending(display)) != 0) { XEvent e; @@ -170,8 +166,12 @@ int main(int argc, char **argv) { case 0x288: case 0x320: case 0x5a0: { + struct timeval now; + cluster_update(&frame); + (void)gettimeofday(&now, NULL); + if (now.tv_sec - last.tv_sec || now.tv_usec - last.tv_usec > 16666) { hexagram_window_refresh_bg(window);