Every request sent from an X client to the X server in the X11 protocol is identified by an opcode. Opcodes 0-127 are reserved for the core X11 protocol. Opcodes 128-255 are used by extensions.
For the core protocol request opcodes, you can find their definitions in any of these places:
- the
X_*
defines at the end of /usr/include/X11/Xproto.h - the
XRequest.*
lines in /usr/share/X11/XErrorDB - the
R* X11:*
lines in /usr/lib/xorg/protocol.txt - the
<request>
elements in the XCB protocol description in /usr/share/xcb/xproto.xml - the X protocol specs at http://www.x.org/releases/current/doc/index.html
Opcodes 128-255 are dynamically assigned to X extensions, depending on which are supported and active in your current X server version/configuration. To see which are which in your currently running X server, run:
xdpyinfo -queryExt | grep opcode
Each extension is assigned a single opcode from that range, also known as it's “major opcode.” For each operation provided by that extension, typically a second byte is used as a “minor opcode.” Minor opcodes for each extension are defined by the extension. For definitions of those, see any of these:
- the headers for that extension in /usr/include/X11/extensions/
- the
XRequest.<extension>.*
lines in /usr/share/X11/XErrorDB - the
R* <extension>:*
lines in /usr/lib/xorg/protocol.txt - the
<request>
elements in the XCB protocol description file for that extension in /usr/share/xcb/*.xml - the X extension protocol specs at http://www.x.org/releases/current/doc/index.html