how to quit the blocking of xlib’s XNextEvent
No. This is why most UI frameworks (Gtk, KDE, etc) use custom main loops to be able to listen for more event sources. Internally, XNextEvent uses a socket, so it calls select() to know when input is available. Call ConnectionNumber(display) to get the file descriptor that you need to pass select() That allows you to … Read more