XErrorEvent(3)

πŸ’… XErrorEvent(3) β€” like, the X error event struct, bestie

okay so this one lives in the XLIB FUNCTIONS family, and honestly? it's the ✨receipt✨ you get when X is like "girl, that request did NOT go through." 🫢


✨ NAME ✨

XErrorEvent β€” the X error event structure. yep, that's the whole vibe. it's a struct. it holds the tea about what went wrong. πŸ“


πŸŽ€ STRUCTURES πŸŽ€

bestie. sit down. here's the whole thing, and i mean the whole thing, comments and all, no cap:

typedef struct {
        int type;
        Display *display;       /* Display the event was read from */
        XID resourceid;         /* resource id */
        unsigned long serial;           /* serial number of failed request */
        unsigned char error_code;       /* error code of failed request */
        unsigned char request_code;     /* Major op-code of failed request */
        unsigned char minor_code;       /* Minor op-code of failed request */
} XErrorEvent;

like, that's it. that's the icon. πŸ‘‘

when you receive this event, the structure members are set as follows β€” main character energy, every field doing its job:

  • type β€” it's there, it's the type field, we love her.
  • display β€” the display the event was read from.
  • resourceid β€” the resource id, i.e. which thing was involved.
  • serial β€” the serial number of the failed request. more on her in a sec πŸ‘‡
  • error_code β€” the error code of the failed request. this is the actual "what went wrong."
  • request_code β€” the major op-code of the failed request.
  • minor_code β€” the minor op-code of the failed request.

πŸ¦‹ the serial member, explained πŸ¦‹

okay so serial is literally the number of requests β€” starting from one β€” sent over the network connection since it was opened. not zero. one. we start at one in this house. πŸ’…

and more specifically: it's the number that was the value of NextRequest immediately before the failing call was made. so like, the last number before everything went sideways. 😭

🌸 the request_code member, explained 🌸

request_code is a protocol request of the procedure that failed, as defined in X11/Xproto.h. that's it. that's the definition. go read the header, iykyk. πŸ“–βœ¨


πŸ”₯ SEE ALSO πŸ”₯

the whole friend group!! go say hi to literally everyone:

plus the big one: Xlib - C Language X Interface β€” the mothership, the blueprint, the blueprintiest blueprint. 🌈


ngl this page is short but it ATE. tiny struct, huge lore. πŸ’€

okay bye bestie, love u!! this page came to you courtesy of X Version 11 and libX11 1.8.14 β€” go forth and debug, you absolute icon πŸ§šπŸ’œπŸŽ€

πŸ“¦ where this page comes from