IT lexicon › Infra & Ops › TinyWM

TinyWM

Infra & Ops På svenska → Updated: 2026-10-09
More info
Creator
Nick Welch
Released
Type
Window manager
License
Public domain
Source
github.com/mackstann/tinywm

A window manager in about fifty lines of C, written in 2005 to show that everything needed to move, resize and raise windows in X fits on one screen.

Nick Welch wrote TinyWM as a teaching example and placed the code in the public domain. The program opens the display, takes passive grabs on Alt+F1 and on Alt with the left and right mouse buttons on the root window, and enters a loop around XNextEvent. Alt+F1 raises the window under the pointer with XRaiseWindow; Alt-dragging with the left button moves and with the right button resizes, through XMoveResizeWindow on every MotionNotify. That is all. No reparenting, no frames, no ICCCM, no focus handling: applications get focus because X gives it to the window under the pointer, if they ask for it at all.

The value is in what is missing. Anyone reading the code sees that a window manager is at bottom just a client that has asked the server to route certain events its way, and that everything making dwm or Openbox usable is built on top of these three grabs. A Python version of the same length comes with it, and TinyWM has since been the starting point for a long line of hobby window managers and a standing first exercise in Xlib tutorials.

← Back to the lexicon