equal
deleted
inserted
replaced
309 if (!XPending(dpy)) { |
309 if (!XPending(dpy)) { |
310 // otherwise STDIN events are held until the first X11 event |
310 // otherwise STDIN events are held until the first X11 event |
311 logOutput << "trace: no pending X11 event" << std::endl; |
311 logOutput << "trace: no pending X11 event" << std::endl; |
312 break; |
312 break; |
313 } |
313 } |
|
314 process_x11_event: |
314 XWindowAttributes gwa; |
315 XWindowAttributes gwa; |
315 XNextEvent(dpy, &xev); |
316 XNextEvent(dpy, &xev); |
316 |
317 |
317 if (xev.type == Expose) { |
318 if (xev.type == Expose) { |
318 std::cout << "XEvent: Expose" << std::endl; |
319 std::cout << "XEvent: Expose" << std::endl; |
378 std::cout << "XEvent: DestroyNotify → finish" << std::endl; |
379 std::cout << "XEvent: DestroyNotify → finish" << std::endl; |
379 break; |
380 break; |
380 } else { |
381 } else { |
381 std::cout << "XEvent: type=" << xev.type << std::endl; |
382 std::cout << "XEvent: type=" << xev.type << std::endl; |
382 } |
383 } |
|
384 if (XPending(dpy)) goto process_x11_event; |
383 } else if (epoll[epollEvent].data.fd == STDIN_FILENO) { |
385 } else if (epoll[epollEvent].data.fd == STDIN_FILENO) { |
384 int epollFD = epoll[epollEvent].data.fd; |
386 int epollFD = epoll[epollEvent].data.fd; |
385 logOutput << "other event: fd=" << epollFD << " data="; |
387 logOutput << "other event: fd=" << epollFD << " data="; |
386 for (char ch; read(epollFD, &ch, 1) > 0;) { |
388 for (char ch; read(epollFD, &ch, 1) > 0;) { |
387 std::stringstream msg; |
389 std::stringstream msg; |