+ if(XPending(dpy) > 0) {
+ XNextEvent(dpy, &ev);
+ if(handler[ev.type])
+ (handler[ev.type]) (&ev); /* call handler */
+ continue;
+ }
+ FD_ZERO(&fds);
+ FD_SET(ConnectionNumber(dpy), &fds);
+ t = timeout;
+ if(select(ConnectionNumber(dpy) + 1, &fds, NULL, NULL, &t) > 0)
+ continue;
+ else if(errno != EINTR) {
+ pipe_spawn(statustext, sizeof(statustext), dpy, (char **)status);
+ draw_bar();
+ }