XSetWMProperties(3)
π XSetWMProperties(3) β setting standard window properties
okay so bestie, real talk: this page lives in the XLIB FUNCTIONS manual, and itβs the whole convenience-function trio for setting standard window properties. if youβve ever wondered how a window tells the rest of the X world who it is, what itβs called, what icon name it wants, and what command launched it β this is that. π«Άβ¨
β¨ NAME β¨
XSetWMProperties, XmbSetWMProperties, Xutf8SetWMProperties β set standard window properties.
π» SYNTAX π»
void XSetWMProperties(Display *display, Window w, XTextProperty
*window_name, XTextProperty *icon_name, char **argv, int argc,
XSizeHints *normal_hints, XWMHints *wm_hints, XClassHint
*class_hints);
void XmbSetWMProperties(Display *display, Window w, _Xconst char
*window_name, _Xconst char *icon_name, char *argv[], int argc,
XSizeHints *normal_hints, XWMHints *wm_hints, XClassHint
*class_hints);
void Xutf8SetWMProperties(Display *display, Window w, _Xconst char
*window_name, _Xconst char *icon_name, char *argv[], int argc,
XSizeHints *normal_hints, XWMHints *wm_hints, XClassHint
*class_hints);
π§Ύ ARGUMENTS π§Ύ
argcβ the number of arguments. yes, literally the count.argvβ the applicationβs argument list. the wholeargvvibe.class_hintsβ theXClassHintstructure to be used. classy.displayβ the connection to the X server. your Display hookup.icon_nameβ the icon name, which should be a null-terminated string. cute icon label, null-terminated pls.normal_hintsβ the size hints for the window in its normal state. the βnormal sizeβ mood.wβ the window. the actual window, bestie.window_nameβ the window name, which should be a null-terminated string. label for the window, null-terminated.wm_hintsβ theXWMHintsstructure to be used. window-manager hints, served.
πΈ DESCRIPTION πΈ
The XSetWMProperties convenience function provides a single programming interface for setting those essential window properties that are used for communicating with other clients β particularly window and session managers. itβs giving one-stop property shop. β¨
- If the
window_nameargument is non-NULL,XSetWMPropertiescallsXSetWMName, which in turn sets theWM_NAMEproperty (see section14.1.4). - If the
icon_nameargument is non-NULL,XSetWMPropertiescallsXSetWMIconName, which sets theWM_ICON_NAMEproperty (see section14.1.5). - If the
argvargument is non-NULL,XSetWMPropertiescallsXSetCommand, which sets theWM_COMMANDproperty (see section14.2.1). Note that anargcof zero is allowed to indicate a zero-length command. - The hostname of this machine is stored using
XSetWMClientMachine(see section14.2.2). - If the
normal_hintsargument is non-NULL,XSetWMPropertiescallsXSetWMNormalHints, which sets theWM_NORMAL_HINTSproperty (see section14.1.7). - If the
wm_hintsargument is non-NULL,XSetWMPropertiescallsXSetWMHints, which sets theWM_HINTSproperty (see section14.1.6).
If the class_hints argument is non-NULL, XSetWMProperties calls XSetClassHint, which sets the WM_CLASS property (see section 14.1.8). If the res_name member in the XClassHint structure is set to the NULL pointer and the RESOURCE_NAME environment variable is set, then the value of the environment variable is substituted for res_name. If the res_name member is NULL, the environment variable is not set, and argv and argv[0] are set, then the value of argv[0], stripped of any directory prefixes, is substituted for res_name. the way that fallback logic ate, fr fr. π
The XmbSetWMProperties and Xutf8SetWMProperties convenience functions provide a simple programming interface for setting those essential window properties that are used for communicating with other clients β particularly window and session managers.
- If the
window_nameargument is non-NULL, they set theWM_NAMEproperty. - If the
icon_nameargument is non-NULL, they set theWM_ICON_NAMEproperty. - The
window_nameandicon_namearguments are null-terminated strings: forXmbSetWMPropertiesin the encoding of the current locale, and forXutf8SetWMPropertiesin UTF-8 encoding. - If the arguments can be fully converted to the
STRINGencoding, the properties are created with typeSTRING; otherwise, the arguments are converted to Compound Text, and the properties are created with typeCOMPOUND_TEXT. - If the
normal_hintsargument is non-NULL,XmbSetWMPropertiesandXutf8SetWMPropertiescallXSetWMNormalHints, which sets theWM_NORMAL_HINTSproperty (see section14.1.7). - If the
wm_hintsargument is non-NULL,XmbSetWMPropertiesandXutf8SetWMPropertiescallXSetWMHints, which sets theWM_HINTSproperty (see section14.1.6). - If the
argvargument is non-NULL,XmbSetWMPropertiesandXutf8SetWMPropertiesset theWM_COMMANDproperty fromargvandargc. Anargcof zero indicates a zero-length command. - The hostname of the machine is stored using
XSetWMClientMachine(see section14.2.2).
If the class_hints argument is non-NULL, XmbSetWMProperties and Xutf8SetWMProperties set the WM_CLASS property. If the res_name member in the XClassHint structure is set to the NULL pointer and the RESOURCE_NAME environment variable is set, the value of the environment variable is substituted for res_name. If the res_name member is NULL, the environment variable is not set, and argv and argv[0] are set, then the value of argv[0], stripped of any directory prefixes, is substituted for res_name.
It is assumed that the supplied class_hints.res_name and argv, the RESOURCE_NAME environment variable, and the hostname of the machine are in the encoding of the current locale. The corresponding WM_CLASS, WM_COMMAND, and WM_CLIENT_MACHINE properties are typed according to the local host locale announcer. No encoding conversion is performed for these strings prior to storage in the properties β not me warning you, just the facts.
For clients that need to process the property text in a locale, XmbSetWMProperties and Xutf8SetWMProperties set the WM_LOCALE_NAME property to be the name of the current locale. The name is assumed to be in the Host Portable Character Encoding and is converted to STRING for storage in the property.
XSetWMProperties, XmbSetWMProperties and Xutf8SetWMProperties can generate BadAlloc and BadWindow errors.
The function Xutf8SetWMProperties is an extension introduced by The XFree86 Project, Inc., in their 4.0.2 release. Its presence is indicated by the macro X_HAVE_UTF8_STRING. iykyk. π¦
π PROPERTIES π
WM_CLASSβ set by application programs to allow window and session managers to obtain the applicationβs resources from the resource database.WM_CLIENT_MACHINEβ the string name of the machine on which the client application is running.WM_COMMANDβ the command and arguments, null-separated, used to invoke the application.WM_HINTSβ additional hints set by the client for use by the window manager. The C type of this property isXWMHints.WM_ICON_NAMEβ the name to be used in an icon.WM_NAMEβ the name of the application.WM_NORMAL_HINTSβ size hints for a window in its normal state. The C type of this property isXSizeHints.
π DIAGNOSTICS π
BadAllocβ the server failed to allocate the requested resource or server memory.BadWindowβ a value for aWindowargument does not name a definedWindow.
π₯ SEE ALSO π₯
XAllocClassHint(3)XAllocIconSize(3)XAllocSizeHints(3)XAllocWMHints(3)XParseGeometry(3)XSetCommand(3)XSetTransientForHint(3)XSetTextProperty(3)XSetWMClientMachine(3)XSetWMColormapWindows(3)XSetWMIconName(3)XSetWMName(3)XSetWMProtocols(3)XStringListToTextProperty(3)XTextListToTextProperty(3)
and the big one: Xlib - C Language X Interface.
π okay bye bestie β this page is from X Version 11, libX11 1.8.14, and yes, itβs XSetWMProperties(3). periodt. π
π¦ 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