XSetWMProtocols(3)
π XSetWMProtocols(3) β XLIB FUNCTIONS π
πΈ NAME πΈ
XSetWMProtocols, XGetWMProtocols β set or read a window's WM_PROTOCOLS property. that's the whole assignment, bestie. iykyk π
β¨ SYNTAX β¨
okay so these are the exact signatures, no cap:
Status XSetWMProtocols(Display *display, Window w, Atom *protocols, int count);
Status XGetWMProtocols(Display *display, Window w, Atom **protocols_return, int *count_return);
π ARGUMENTS π
displayβ specifies the connection to the X server. literally the server link.countβ specifies the number of protocols in the list. the count, the number, the vibe.count_returnβ returns the number of protocols in the list. ngl, it's the return-value bestie.protocolsβ specifies the list of protocols. the list you're handing over.protocols_returnβ returns the list of protocols. yes, it returns the list. π
π¦ DESCRIPTION π¦
okay so XSetWMProtocols is the one that replaces the WM_PROTOCOLS property on the specified window with the list of atoms you passed in protocols. if that property does not already exist, XSetWMProtocols sets the WM_PROTOCOLS property on the specified window to the list of atoms specified by the protocols argument. no drama, it just sets it. lowkey main character energy.
the property is stored with a type of ATOM and a format of 32. periodt.
if it cannot intern the WM_PROTOCOLS atom, XSetWMProtocols returns a zero status. otherwise, it returns a nonzero status. slay.
XSetWMProtocols can generate BadAlloc and BadWindow errors. keep that in mind, bestie.
XGetWMProtocols is the read girlie: it returns the list of atoms stored in the WM_PROTOCOLS property on the specified window. those atoms describe window manager protocols in which the owner of this window is willing to participate. it's giving "these are the protocols I'm down for."
if the property exists, is of type ATOM, is of format 32, and the atom WM_PROTOCOLS can be interned, XGetWMProtocols sets the protocols_return argument to a list of atoms, sets the count_return argument to the number of elements in the list, and returns a nonzero status. iconic.
otherwise, it sets neither of the return arguments and returns a zero status. π fr fr.
to release the list of atoms, use XFree. don't forget, or it's giving leak vibes.
XGetWMProtocols can generate a BadWindow error.
π PROPERTIES π
WM_PROTOCOLSβ list of atoms that identify the communications protocols between the client and window manager in which the client is willing to participate. that's the whole vibe of this property.
π DIAGNOSTICS π
BadAllocβ the server failed to allocate the requested resource or server memory. not the moment, honestly.BadWindowβ a value for aWindowargument does not name a definedWindow. vibe check your window, bestie.
π SEE ALSO π
XAllocClassHint(3)XAllocIconSize(3)XAllocSizeHints(3)XAllocWMHints(3)XFree(3)XSetCommand(3)XSetTransientForHint(3)XSetTextProperty(3)XSetWMClientMachine(3)XSetWMColormapWindows(3)XSetWMIconName(3)XSetWMName(3)XSetWMProperties(3)XStringListToTextProperty(3)
also: Xlib - C Language X Interface β the big classic. π«Ά
π okay that's the whole page! obsessed. X Version 11, libX11 1.8.14, XSetWMProtocols(3), signing off β 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