IT lexicon › Programming › Xlib

Xlib

Programming På svenska → Updated: 2026-10-06

The C library that turns function calls into X protocol messages, and that hardly anyone calls directly any more.

Xlib came with X from the start, offering calls like XOpenDisplay, XCreateWindow and XNextEvent. It buffers requests and hides the fact that the server may live on another machine, but plenty of calls block waiting for a reply, which turns network latency into a sluggish interface. Written against raw Xlib, "hello world" runs to a couple of pages.

Hence the toolkits stacked on top: Xt and Motif, later GTK and Qt. In 2001 Bart Massey started XCB, a smaller, asynchronous alternative, and since the mid-2000s Xlib itself has been implemented on top of XCB.

← Back to the lexicon