NAME
XSetWMProperties — set a window’s standard window manager properties.
SYNOPSIS
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;
ARGUMENTS
displaySpecifies a connection to an X server; returned from XOpenDisplay().
wSpecifies the window.
window_name
Specifies the window name, which should be a null-terminated string.
icon_nameSpecifies the icon name, which should be a null-terminated string.
argvSpecifies the application’s argument list.
argcSpecifies the number of arguments.
normal_hints
Specifies the size hints for the window in its normal state.
wm_hintsSpecifies the XWMHints structure to be used.
class_hints
Specifies the XClassHint structure to be used.
AVAILABILITY
Release 4 and later.
DESCRIPTION
XSetWMProperties() provides a single programming interface for setting the essential window properties that communicate with window and session managers. XSetWMProperties() supersedes XSetStandardProperties().
If the window_name argument is non-null, XSetWMProperties() calls XSetWMName(), which, in turn, sets the WM_NAME property. If the icon_name argument is non-null, XSetWMProperties() calls XSetWMIconName(), which sets the WM_ICON_NAME property. If the argv argument is non-null, XSetWMProperties() calls XSetCommand(), which sets the WM_COMMAND property. Note that an argc of 0 is allowed to indicate a zero-length command. XSetWMProperties() stores the hostname of this machine using XSetWMClientMachine().
If the normal_hints argument is non-null, XSetWMProperties() calls XSetWMNormalHints(), which sets the WM_NORMAL_HINTS property. If the wm_hints argument is non-null, XSetWMProperties() calls XSetWMHints(), which sets the WM_HINTS property.
If the class_hints argument is non-null, XSetWMProperties() calls XSetClassHint(), which sets 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 value of the environment variable is substituted for res_name. If the res_name member is NULL, and if the environment variable is not set, and if argv and argv[0] are set, then the value of argv[0], stripped of any directory prefixes, is substituted for res_name.
For more information, see Volume One, Chapter 10, Interclient Communication.
STRUCTURES
typedef struct {
unsigned char ∗value; /∗ same as Property routines ∗/
Atom encoding; /∗ prop type ∗/
int format; /∗ prop data format: 8, 16, or 32 ∗/
unsigned long nitems; /∗ number of data items in value ∗/ } XTextProperty;
typedef struct {
long flags; /∗ marks which fields in this structure ∗/
/∗ are defined ∗/
int x, y; /∗ obsolete for new window mgrs, but clients ∗/
int width, height; /∗ should set so old wm’s don’t mess up ∗/
int min_width, min_height;
int max_width, max_height;
int width_inc, height_inc;
struct {
int x; /∗ numerator ∗/
int y; /∗ denominator ∗/
} min_aspect, max_aspect;
int base_width, base_height; /∗ added by ICCCM version 1 ∗/
int win_gravity; /∗ added by ICCCM version 1 ∗/ } XSizeHints;
/∗ flags argument in size hints ∗/ #define USPosition (1L << 0) /∗ user specified x, y ∗/ #define USSize (1L << 1) /∗ user specified width, height ∗/ #define PPosition (1L << 2) /∗ program specified position ∗/ #define PSize (1L << 3) /∗ program specified size ∗/ #define PMinSize (1L << 4) /∗ program specified minimum size ∗/ #define PMaxSize (1L << 5) /∗ program specified maximum size ∗/ #define PResizeInc (1L << 6) /∗ program specified resize increments ∗/ #define PAspect (1L << 7) /∗ program specified min/max aspect ratios ∗/ #define PAllHints (PPosition|PSize|PMinSize|PMaxSize|PResizeInc|PAspect) #define PBaseSize (1L << 8) /∗ program specified base for incrementing ∗/ #define PWinGravity (1L << 9) /∗ program specified window gravity ∗/
typedef struct {
long flags; /∗ marks which fields in this structure ∗/
/∗ are defined ∗/
Bool input; /∗ does this application rely on the window ∗/
/∗ manager to get keyboard input? ∗/
int initial_state; /∗ see below ∗/
Pixmap icon_pixmap; /∗ pixmap to be used as icon ∗/
Window icon_window; /∗ window to be used as icon ∗/
int icon_x, icon_y; /∗ initial position of icon ∗/
Pixmap icon_mask; /∗ icon mask bitmap ∗/
XID window_group; /∗ id of related window group ∗/
/∗ this structure may be extended in the future ∗/ } XWMHints;
#define InputHint (1L << 0) #define StateHint (1L << 1) #define IconPixmapHint (1L << 2) #define IconWindowHint (1L << 3) #define IconPositionHint (1L << 4) #define IconMaskHint (1L << 5) #define WindowGroupHint (1L << 6)
#define AllHints (InputHint|StateHint|IconPixmapHint|IconWindowHint\
|IconPositionHint|IconMaskHint|WindowGroupHint) #define PBaseSize (1L << 8) /∗ program specified base for incrementing ∗/ #define PWinGravity (1L << 9) /∗ program specified window gravity ∗/
typedef struct {
char ∗res_name;
char ∗res_class; } XClassHint;
ERRORS
BadAlloc
BadWindow
SEE ALSO
XGetClassHint(), XGetCommand(), XGetWMHints(), XGetWMIconName(), XGetWMName(), XGetWMNormalHints(), XSetWMClientMachine(), XSetWMColormapWindows(), XSetWMProtocols().
Xlib Reference Manual