Xlibe: an Xlib/X11 compatibility layer for Haiku

The main aim in this whole endeavor was mainly GTK, though. Indeed as previously mentioned, its internals are not very pretty; I would probably go so far as to call them downright ugly; in many ways it is the total antithesis of Haiku’s philosophies and designs for code. And the sheer amount of code it has is its own kind of ridiculous; when I was tracing through it last night to work around a crash caused by failing to load an image file, I wound up about 8-10 functions deep in a call stack just for loading an icon! (There were dozens of functions above that before the icon-loading code was invoked.)

But, well, plenty of major software relies heavily on GTK, including GIMP and Inkscape and Firefox, so this is an important thing to work on.

I would definitely go so far to say, though, that Xlib/X11, for all their problems (and for all I’ve made fun of them or loudly complained about them over the years, or even just in the past few weeks while working on this new compatibility layer), they are in at least some ways kind of fun to work with. (I’ve definitely had more than a bit of fun working on Xlibe so far, although some of that is due to the Haiku APIs being fun to work with.) The same cannot at all be said of GTK. I already dread opening a Debugger to delve into a GTK problem, and I’ve only just started working with GTK just in the past few days.

To put it more succinctly: GTK is just an absolute disaster of a library. Xlib is, by comparison, downright sane and reasonable. That isn’t even an exaggeration.

8 Likes