GenericEvents part 2

Peter Hutterer mailinglists at
Tue Feb 27 01:56:52 PST 2007

I continued a bit on XGE and did a bit of a rework on it. As a  
result, it doesn't break the ABI* any more and it supports long events.

In short:
- moved to Xext
- opcode 35 for GenericEvents
- no extra work for client side extensions
- major opcode as extension identifier
- support for events > 32 bytes

XGE is part of libXext which seemed to be a good place and also made  
integration fairly easy. Also allowed me to keep the ABI*.
I took the liberty of taking opcode 35 to type GenericEvent, made a  
few things easier.

Extensions on the client side don't have to register any more,  
XextAddDisplay takes care of it. The extension's event handling hooks  
are called for generic events as well. The client side of an  
extension doesn't really have to do anything more than it does  
anyway. After all, Xlib is evil enough and you're punished enough if  
you have to write the standard stuff.

Instead of some arbitrary number, extensions now use the major opcode  
as identifier in byte 2 of an event, so we can support up to 128  
extensions. This means (rough calculation) that if we keep adding  
extensions at the current rate it'll last somewhere around 100 years,  
by which I'll be already gone and it'll be somebody else's problem to  
fix it.

Probably the most interesting feature is the support for long events.  
Events can now work like replies, with a length field that specifies  
the number of 4 byte blocks after the initial 32 bytes. There are  
some server changes to not automatically assume 32 bytes for an event  
when delivering and some xcb/xlib changes to receive and pass on the  
right events. ABI did not break*. Event type is now a CARD16, so  
daniel can have his 2^16 events per extension.

I was sending the "lorem ipsum" blah blah as a randomStringEvent   
(now part of XI), with varying number of bytes. So far, I have tested  
various string lengths up to 700 bytes. More testing to come, until I  
can quote it by heart. I think there is a size restriction to 96  
bytes max in Xlib but for some reason it works nevertheless. Need to  
dig into this.

Diffs for libX11, libXext, libxcb, xextproto and xserver are up on
git repos for the libs and proto changes are available from http://


* I didn't really know what an ABI is before yesterday, so I there  
may be issues left. I tested several standard applications and they  
don't shout at me anymore.

Multi-Pointer X Server

More information about the xorg mailing list