Skip to content
Snippets Groups Projects
Commit f7e6a0d0 authored by Martin Mareš's avatar Martin Mareš
Browse files

Explain the exit-on-X-server-shutdown trick

parent 0ab80500
Branches
No related tags found
No related merge requests found
...@@ -102,6 +102,8 @@ osd_wait(int delay) ...@@ -102,6 +102,8 @@ osd_wait(int delay)
poll(&pfd, 1, wait_until - now); poll(&pfd, 1, wait_until - now);
if (pfd.revents & POLLIN) 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; XEvent ev;
while (XPending(dpy)) while (XPending(dpy))
XNextEvent(dpy, &ev); XNextEvent(dpy, &ev);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment