XPropertyEvent(3)

🌸 NAME 🌸

XPropertyEvent(3) is the PropertyNotify event structure from the XLIB FUNCTIONS manual β€” aka the little C struct that tells you a window’s property just got changed or deleted. πŸ’… bestie, it’s giving β€œI know what happened to that atom,” and we’re obsessed.

πŸ¦‹ STRUCTURES πŸ¦‹

The structure for PropertyNotify events contains:

typedef struct {
        int type;       /* PropertyNotify */
        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 atom;
        Time time;
        int state;      /* PropertyNewValue or PropertyDelete */
} XPropertyEvent;

When you receive this event, the structure members are set as follows. no cap, here’s the member-by-member tea:

  • type β€” set to the event type constant name that uniquely identifies it. For 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. iconic behavior, honestly.
  • 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. yes, that’s the general boilerplate member vibe, iykyk.
  • window β€” okay but for real, the property-specific one: set to the window whose associated property was changed. main character energy.
  • atom β€” set to the property’s atom and indicates which property was changed or desired.
  • time β€” set to the server time when the property was changed.
  • state β€” set to indicate whether the property was changed to a new value or deleted, and can be PropertyNewValue or PropertyDelete.

The state member is set to PropertyNewValue when a property of the window is changed using XChangeProperty or XRotateWindowProperties (even when adding zero-length data using XChangeProperty) and when replacing all or part of a property with identical data using XChangeProperty or XRotateWindowProperties. slay, even identical-data replacements count. ✨

The state member is set to PropertyDelete when a property of the window is deleted using XDeleteProperty or, if the delete argument is True, XGetWindowProperty. so yeah, that’s the deletion pipeline, periodt.

πŸŽ€ SEE ALSO πŸŽ€

Go give these siblings a read, bestie β€” full guest list, in order:

And the big classic: Xlib - C Language X Interface. 🫢


kisses and property-change notifications πŸ’– this little page is serving X Version 11, libX11 1.8.14, and XPropertyEvent(3) energy. periodt. πŸŽ€

πŸ“¦ where this page comes from