void XSetWMProperties(display, w, window_name, icon_name, argv, argc, normal_hints, wm_hints, class_hints)
      Display *display; 
      Window w;
      XTextProperty *window_name;
      XTextProperty *icon_name;
      char **argv;
      int argc;
      XSizeHints *normal_hints;
      XWMHints *wm_hints;
      XClassHint *class_hints;


display Specifies the connection to the X server.
w Specifies the window.
window_name Specifies the window name, which should be a null-terminated string.
icon_name Specifies the icon name, which should be a null-terminated string.
argv Specifies the application's argument list.
argc Specifies the number of arguments.
normal_hints Specifies the size hints for the window in its normal state.
wm_hints Specifies the XWMHints structure to be used.
class_hints Specifies the XClassHint structure to be used.


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).

If the window_name argument is non-NULL, XSetWMProperties() calls XSetWMName(), which in turn, sets the WM_NAME property (see "Setting and Reading the WM_NAME Property"). If the icon_name argument is non-NULL, XSetWMProperties() calls XSetWMIconName(), which sets the WM_ICON_NAME property (see "Setting and Reading the WM_ICON_NAME Property"). If the argv argument is non-NULL, XSetWMProperties() calls XSetCommand(), which sets the WM_COMMAND property (see "Setting and Reading the WM_COMMAND Property"). Note that an argc of zero is allowed to indicate a zero-length command. Note also that the hostname of this machine is stored using XSetWMClientMachine() (see "Setting and Reading the WM_CLIENT_MACHINE Property").

If the normal_hints argument is non-NULL, XSetWMProperties() calls XSetWMNormalHints(), which sets the WM_NORMAL_HINTS property (see "Setting and Reading the WM_NORMAL_HINTS Property"). If the wm_hints argument is non-NULL, XSetWMProperties() calls XSetWMHints(), which sets the WM_HINTS property (see "Setting and Reading the WM_HINTS Property").

If the class_hints argument is non-NULL, XSetWMProperties() calls XSetClassHint(), which sets the WM_CLASS property (see "Setting and Reading 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, 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.

XSetWMProperties() can generate BadAlloc and BadWindow errors.


BadAlloc The server failed to allocate the requested source or server memory.
BadWindow A value for a Window argument does not name a defined Window.

See also

XAllocClassHint(), XAllocIconSize(), XAllocSizeHints(), XAllocWMHints(), XmbSetWMProperties(), XParseGeometry(), XSetCommand(), XSetTransientForHint(), XSetTextProperty(), XSetWMClientMachine(), XSetWMColormapWindows(), XSetWMIconName(), XSetWMName(), XSetWMProtocols(), XStringListToTextProperty(), XTextPropertyToStringList(), "Using Window Manager Convenience Functions".
Christophe Tronche, ch@tronche.com