/** * Generic XI2 event. All XI2 events have the same header. */ typedef struct { int type; /* GenericEvent */ unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ int extension; /* XI extension offset */ int evtype; Time time; } XIEvent;

cool, makes sense, shared event header… okay let’s look at the events…

typedef struct { int type; /* GenericEvent */ unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ int extension; /* XI extension offset */ int evtype; /* XI_DeviceChanged */ Time time; int deviceid; /* id of the device that changed */ int sourceid; /* Source for the new classes. */ int reason; /* Reason for the change */ int num_classes; XIAnyClassInfo **classes; /* same as in XIDeviceInfo */ } XIDeviceChangedEvent;

no no no no no not like that, why is XIEvent not embedded there?? the fuck

i bet the implementation of those event functions is a cast-fest and strict aliasing nightmare

@navi Yeah truly an X11 moment, so glad it's becoming more and more legacy
@lanodan i really don't like libwayland at all

but hell every time i have to interact with libX11 or libxcb i wish it was libwayland instead

insanity
@navi Yeah, not a huge fan of libwayland but at least it's an helper library so it's possible to not use it.
While for X11, I'd expect a lot of nasal dæmons if you'd want to skip libX11/libxcb (hence why even non-C languages still bind to it).
@lanodan @navi libwayland and libxcb are pretty similar in what they provide, no? And you can always talk both X11 and Wayland yourself, from whatever language, except where you can’t because Mesa’s EGL implementation depends on specific client libraries.
@humm @navi Well for X11 I've yet to see software doing it and I'd be a bit surprised if the xml stuff in xcb-proto is complete enough, with X11 having been there for decades.
While for wayland I've seen it quite few times.