XExposeEvent(3)
π XExposeEvent β the manual, but make it make sense
okay bestie, so you're deep in Xlib land and the Expose event is knocking on your door. this is from the XLIB FUNCTIONS corner of the world, and it's the XExposeEvent page. buckle up, it's giving "your window needs a glow-up" energy β¨
πΈ NAME πΈ
XExposeEvent β literally the Expose event structure, that's the whole vibe π
π¦ STRUCTURES π¦
so the structure for Expose events contains this, and yes you're gonna want to screenshot it:
typedef struct {
int type; /* Expose */
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;
int x, y;
int width, height;
int count; /* if nonzero, at least this many more */
} XExposeEvent;
when you receive this event, the structure members are set as follows β okay so let's go member by member, no skips π
the type member is 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. (iykyk π)
the display member is set to a pointer to the display the event was read on.
the send_event member is set to True if the event came from a SendEvent protocol request.
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. (yes, glow-up from 16 to 32 bits, we love a growth arc π)
the window member is set to the window that is most useful to toolkit dispatchers.
π«Ά the window bits (this is the good part)
the window member is set to the exposed (damaged) window. your poor little window got damaged π
the x and y members are set to the coordinates relative to the window's origin and indicate the upper-left corner of the rectangle.
the width and height members are set to the size (extent) of the rectangle.
the count member is set to the number of Expose events that are to follow.
- if
countis zero, no more Expose events follow for this window. periodt. β¨ - however, if
countis nonzero, at least that number of Expose events (and possibly more) follow for this window. so like, brace yourself π
ngl simple applications that do not want to optimize redisplay by distinguishing between subareas of its window can just ignore all Expose events with nonzero counts and perform full redisplays on events with zero counts. that's the lazy-girl strategy and honestly? iconic. π
π₯ SEE ALSO π₯
the whole friend group, all here, all referenced:
XAnyEvent(3)XButtonEvent(3)XCreateWindowEvent(3)XCirculateEvent(3)XCirculateRequestEvent(3)XColormapEvent(3)XConfigureEvent(3)XConfigureRequestEvent(3)XCrossingEvent(3)XDestroyWindowEvent(3)XErrorEvent(3)XFocusChangeEvent(3)XGraphicsExposeEvent(3)XGravityEvent(3)XKeymapEvent(3)XMapEvent(3)XMapRequestEvent(3)XPropertyEvent(3)XReparentEvent(3)XResizeRequestEvent(3)XSelectionClearEvent(3)XSelectionEvent(3)XSelectionRequestEvent(3)XUnmapEvent(3)XVisibilityEvent(3)
and also Xlib - C Language X Interface β the big one, the main character π
and that's the whole page bestie, go forth and redisplay π β¨
this lil gem is from X Version 11, libX11 1.8.14, dated the classic manpage era β sending you off with a kiss, mwah π«Άπ
π¦ where this page comes from
- alpine 3.24: libx11-doc 1.8.14-r0 Β· X11
- arch rolling: libx11 1.8.14-1 Β· MIT AND X11
- nixos 26.05: libx11 1.8.14
- nixpkgs unstable: libx11 1.8.14
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms