XUnmapEvent(3)

πŸ’œ XUnmapEvent(3) β€” the XLIB FUNCTIONS girlies' guide to UnmapNotify

okay bestie, so this one lives in the XLIB FUNCTIONS section of the X Version 11 manuals, and it's literally just the whole tea on the UnmapNotify event structure. it's short, it's sweet, it's giving "small but mighty" ✨


🌸 NAME 🌸

XUnmapEvent β€” the UnmapNotify event structure, periodt. πŸ’…


πŸŽ€ STRUCTURES πŸŽ€

so the structure for UnmapNotify events contains β€” and yes, we're copying it exactly, no cap, don't @ me:

typedef struct {
        int type;       /* UnmapNotify */
        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 event;
        Window window;
        Bool from_configure;
} XUnmapEvent;

when you receive this event, the structure members are set as follows. ok so let's break it down field by field 🫢

the type member is set to the event type constant name that uniquely identifies it. for example β€” and this is the glow-up example, iykyk β€” when the X server reports a GraphicsExpose event to a client application, it sends an XGraphicsExposeEvent structure with the type member set to GraphicsExpose. see how that works? the name matches the vibe. ⭐

the display member is set to a pointer to the display the event was read on. simple as that, no notes. πŸ’–

the send_event member is set to True if the event came from a SendEvent protocol request. that's it, that's the whole rule.

the serial member is set from the serial number reported in the protocol β€” but expanded from the 16-bit least-significant bits to a full 32-bit value. so it's the same number, just living its full 32-bit main character era. πŸ”₯

the window member is set to the window that is most useful to toolkit dispatchers. (hold that thought β€” she comes back later πŸ‘€)

the event member is set either to the unmapped window or to its parent, depending on whether StructureNotify or SubstructureNotify was selected. this is the window used by the X server to report the event. so like, it depends on what you asked for, bestie. πŸ™ˆ

the window member β€” yes, her again β€” is set to the window that was unmapped. πŸ’€ (both facts are true, that's just how she is.)

the from_configure member is set to True if the event was generated as a result of a resizing of the window's parent when the window itself had a win_gravity of UnmapGravity. that's the whole condition, don't skip a word of it β€” UnmapGravity, ok? πŸ¦‹

ngl, if you're checking from_configure you probably want to be real careful about which win_gravity the window was rocking. the manpage says exactly one thing and that thing is UnmapGravity. no extras, no guessing, that's the rule. 🌈

🌟 SEE ALSO 🌟

the whole friend group, in the exact order the page gives them β€” every single one, no cuts:

and also Xlib - C Language X Interface β€” the big book, the source material, the mothership. πŸ“šπŸ‘‘


that's the whole page bestie, we ate and left absolutely no crumbs πŸ“

kisses from X Version 11, libX11 1.8.14, and yours truly β€” mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from