X Generic Event Extension

The X Generic Event extension (XGE) grew out of the problem that X only allows 64 event opcodes for all extensions together. Right now, there are only around 15 or so left, depending on how many extensions are enabled in your server. XGE simply defines one new event opcode (35, GenericEvent) in the core protocol, and then re-uses this opcode for multiple events.

The actual type of an event is specified as the combination of extension and evtype. extension specifies the matching extension's major opcode. evtype is a static type as defined for this extension. evtype must be unique within the extension.

Long events

XGE allows events that are longer than the standard X protocol's 32 byte events. The length field of a GenericEvent defines the number of bytes after the initial 32 bytes in 4 byte units.

Sending long events requires an XGE-aware libX11/libxcb! The server must not send a long event unless it is sure that the client supports XGE, otherwise the protocol will be unaligned. libX11 without xcb support does not support GenericEvents.