XClientMessageEvent(3)

πŸ’… XClientMessageEvent(3) β€” ClientMessage event structure 🫢

okay so this is the Xlib functions page for XClientMessageEvent(3), and it’s literally all about the ClientMessage event structure. Pull up a chair, bestie.

🌸 NAME 🌸

XClientMessageEvent β€” ClientMessage event structure. That’s the name, no cap.

🧚 STRUCTURES 🧚

the struct for ClientMessage events is literally this:

typedef struct {
        int type;       /* ClientMessage */
        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 */
        Window window;
        Atom message_type;
        int format;
        union {
                char b[20];
                short s[10];
                long l[5];
                } data;
} XClientMessageEvent;

when this event lands, the members are set like this:

  • type β€” set to the event type constant name that uniquely identifies it. Example: when the X server reports a GraphicsExpose event to a client application, it sends an XGraphicsExposeEvent structure with the type member set to GraphicsExpose. πŸ’…
  • display β€” set to a pointer to the display the event was read on.
  • send_event β€” set to True if the event came from a SendEvent protocol request.
  • serial β€” set from the serial number reported in the protocol, but expanded from the 16-bit least-significant bits to a full 32-bit value.
  • window β€” set to the window that is most useful to toolkit dispatchers.
  • message_type β€” set to an atom that indicates how the data should be interpreted by the receiving client.
  • format β€” set to 8, 16, or 32; it specifies whether the data should be viewed as a list of bytes, shorts, or longs.
  • data β€” a union that contains the members b, s, and l. The b, s, and l members represent data of twenty 8-bit values, ten 16-bit values, and five 32-bit values. Particular message types might not make use of all these values.
🚨 okay important: the X server places no interpretation on the values in the window, message_type, or data members. It’s giving β€œyou figure out the meaning, bestie.”

πŸ¦‹ SEE ALSO πŸ¦‹

these are the related pages, all of them, in the original order:

and then: Xlib - C Language X Interface 🫢


that’s the whole page, bestie. signed off from X Version 11, libX11 1.8.14, page XClientMessageEvent(3) β€” mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from