3 ms·
You forgot my favorite one! Xlib is written so badly that there is no graceful way to deal with a connection error to the server - the library gives you one ca
by nrdvana 7y ago
You forgot my favorite one! Xlib is written so badly that there is no graceful way to deal with a connection error to the server - the library gives you one callback to clean up and then it forcibly aborts the process. I looked into why, and its basically because they have no provision for cleanup of failed function calls. If a function can’t return the expected result it would either leave behind a broken internal state of the library or segfault, so they call abort() as a workaround.
If not for this glaring design disaster, it would be possible for a program to attempt re-connecting to a new display server after the previous one crashed. No X11 program has ever done this only because Xlib made it impossible.
- joosters 7y agoWould it be possible to solve this by creating a proxy between the xlib application and the X server? This proxy could re-issue failed requests, or reroute them to a different server. Basically, it would be the error-handling layer, so that all xlib calls always seem to work, from the application's viewpoint. As a proxy, it could improve error handling across all X applications without any application code changes.
- DonHopkins 7y agoIt would be better for life on Earth as we know it if the proxy simply cut you off from the X server, forcing you to find a better window system to use. It's much better to prevent errors from happening in the first place, than to handle them after they happen.