XSelectionEvent(3)
β¨ XSelectionEvent(3) β SelectionNotify Event Structure β¨
Okay bestie, so this page is from the XLIB FUNCTIONS section and it's literally all about XSelectionEvent β the structure for SelectionNotify events. I'm gonna walk you through it, no cap. π
π¦ STRUCTURES π¦
The structure for SelectionNotify events contains:
typedef struct {
int type; /* SelectionNotify */
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 requestor;
Atom selection;
Atom target;
Atom property; /* atom or None */
Time time;
} XSelectionEvent;
When you receive this event, the structure members are set as follows β and yes, I'm gonna break it down so you don't have to guess. π«Ά
- The
typemember is set to the event type constant name that uniquely identifies it. For example, when the X server reports aGraphicsExposeevent to a client application, it sends anXGraphicsExposeEventstructure with thetypemember set toGraphicsExpose. Iconic. - The
displaymember is set to a pointer to the display the event was read on. - The
send_eventmember is set toTrueif the event came from aSendEventprotocol request. - The
serialmember 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. - The
windowmember is set to the window that is most useful to toolkit dispatchers. Main character energy fr fr.
Now for the rest of the members β these are the ones that tell you all about the selection itself:
- The
requestormember is set to the window associated with the requestor of the selection. - The
selectionmember is set to the atom that indicates the selection. For example,PRIMARYis used for the primary selection. - The
targetmember is set to the atom that indicates the converted type. For example,PIXMAPis used for a pixmap. - The
propertymember is set to the atom that indicates which property the result was stored on. If the conversion failed, thepropertymember is set toNone. π (that's the sad path, bestie) - The
timemember is set to the time the conversion took place and can be a timestamp orCurrentTime.
π SEE ALSO π
You already know I gotta shout out the whole squad β every single one of these is a real manpage, so go read them if you're curious:
XAnyEvent(3)XButtonEvent(3)XCreateWindowEvent(3)XCirculateEvent(3)XCirculateRequestEvent(3)XColormapEvent(3)XConfigureEvent(3)XConfigureRequestEvent(3)XCrossingEvent(3)XDestroyWindowEvent(3)XErrorEvent(3)XExposeEvent(3)XFocusChangeEvent(3)XGraphicsExposeEvent(3)XGravityEvent(3)XKeymapEvent(3)XMapEvent(3)XMapRequestEvent(3)XPropertyEvent(3)XReparentEvent(3)XResizeRequestEvent(3)XSelectionClearEvent(3)XSelectionRequestEvent(3)XUnmapEvent(3)XVisibilityEvent(3)
And of course, the big one: Xlib - C Language X Interface β the whole vibe, iykyk. π
Okay that's the whole page, bestie. This one's from X Version 11, libX11 1.8.14, and the date line says XSelectionEvent(3) β slay, you're all caught up! πβ¨π
π¦ 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