IT lexicon › Programming › WM_CLASS

WM_CLASS

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

The ICCCM property carrying a program's instance and class names, which the resource database and window managers use to tell which application a window belongs to.

Every top-level window in X is expected to carry WM_CLASS: two strings, instance name and class name, set with XSetClassHint. The ICCCM convention is that the class is the program's name capitalised, XTerm, and the instance is the name it was started under, xterm or whatever was given with -name. The pair existed originally for the resource database: the line XTerm*background applies to all xterm windows, while an instance started with -name mail can get its own colours. xprop shows the pair as WM_CLASS(STRING) = "xterm", "XTerm".

Window managers adopted the property as an address. The rules in fvwm, Openbox, i3 and devilspie, this program always on desktop 3, that one without a frame, match on WM_CLASS, and panels pick icons by assuming the class name corresponds to a .desktop file. It holds up about as well as you would expect: Java programs and Electron apps sometimes set the same class on everything, and Chrome gives each web app its own class beginning with crx_. Wayland replaced the pair with a single string, app_id in xdg-shell, which is supposed to be exactly the .desktop file's name.

← Back to the lexicon