#include <X11/Xatom.h>
#undef DEBUG
+#include "util.h"
#include "osd.h"
static Display *dpy;
poll(&pfd, 1, wait_until - now);
if (pfd.revents & POLLIN)
{
+ // We use the event loop only to detect that the X server has been shut down.
+ // In such cases, xlib raises an error and exits.
XEvent ev;
while (XPending(dpy))
XNextEvent(dpy, &ev);