IT lexicon › Infra & Ops › Drawable (X11)

Drawable (X11)

Infra & Ops På svenska → Updated: 2026-10-08

The X protocol's collective name for anything you can draw on: a window or a pixmap, treated identically by every drawing request.

X11 separates what is visible from where you draw. A window is a surface on screen with a position, a place in the stacking order and events; a pixmap is a block of server memory with none of those. Yet every drawing request — PolyLine, FillRectangle, PutImage, CopyArea — takes only a drawable as its target, and the protocol does not care which kind it gets. That is why double buffering can be done by hand: draw into a pixmap, copy to the window. The requirements are that the depth matches between the drawable and the graphics context, that both belong to the same screen, and that the window is of class InputOutput; an InputOnly window, which exists purely to catch events, answers any attempt to draw on it with BadMatch.

The family grew over time. The Composite extension turns every redirected window into a pixmap behind the scenes, and XCompositeNameWindowPixmap hands it out so a compositing window manager can paint the window as a texture. XRender layers its Picture on top of a drawable, GLX has GLXDrawable for windows, pixmaps and pbuffers, and Cairo's X backend takes a drawable as its argument. In Xlib the type is just a resource ID, so a drawable is at bottom a promise that the number you send refers to something the server can draw on. Wayland has no equivalent; there the client sends finished buffers, and the server draws nothing for anyone.

← Back to the lexicon