# HG changeset patch # User František Kučera # Date 1701813325 -3600 # Node ID 0899e966993efaf18deb04004bf963cf5939128d # Parent 262828ae96825998154b7a355aa20b97e9ad36ed process all X11 event waiting in the queue in the same cycle avoid so called glitches after continuous key press or X11 tunelled through SSH diff -r 262828ae9682 -r 0899e966993e Shark.cpp --- a/Shark.cpp Mon Dec 04 21:03:53 2023 +0100 +++ b/Shark.cpp Tue Dec 05 22:55:25 2023 +0100 @@ -311,6 +311,7 @@ logOutput << "trace: no pending X11 event" << std::endl; break; } +process_x11_event: XWindowAttributes gwa; XNextEvent(dpy, &xev); @@ -380,6 +381,7 @@ } else { std::cout << "XEvent: type=" << xev.type << std::endl; } + if (XPending(dpy)) goto process_x11_event; } else if (epoll[epollEvent].data.fd == STDIN_FILENO) { int epollFD = epoll[epollEvent].data.fd; logOutput << "other event: fd=" << epollFD << " data="; diff -r 262828ae9682 -r 0899e966993e shaders/default.frag --- a/shaders/default.frag Mon Dec 04 21:03:53 2023 +0100 +++ b/shaders/default.frag Tue Dec 05 22:55:25 2023 +0100 @@ -16,4 +16,5 @@ // fColor *= vec4(0.8, 1., 0.2, 1.); // if (fColor.a < 0.1) discard; + // Pretty, pretty, pretty, pretty, Peggy Sue }