XSetWMProperties(3X11RISC/os Reference ManuXSetWMProperties(3X11)
NAME
XSetWMProperties, XWMGeometry - window manager convenience
functions
SYNTAX
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;
XSize_hints *normal_hints;
XWMHints *wm_hints;
XClassHint *class_hints;
int XWMGeometry(display, screen, user_geom, def_geom,
bwidth, hints, x_return, y_return,
width_return, height_return, gravity_return)
Display *display;
int screen;
char *user_geom;
char *def_geom;
unsigned int bwidth;
XSizeHints *hints;
int *x_return, *y_return;
int *width_return;
int *height_return;
int *gravity_return;
ARGUMENTS
argc Specifies the number of arguments.
argv Specifies the application's argument list.
bwidth Specifies the border width.
class_hints
Specifies the XClassHint structure to be used.
def_geom Specifies the application's default geometry or
NULL.
display Specifies the connection to the X server.
gravity_return
Returns the window gravity.
hints Specifies the size hints for the window in its
normal state.
Printed 1/24/91 Release 4 Page 1
XSetWMProperties(3X11RISC/os Reference ManuXSetWMProperties(3X11)
icon_name Specifies the icon name, which should be a null-
terminated string.
normal_hints
Specifies the size hints for the window in its
normal state.
screen Specifies the screen.
user_geom Specifies the user-specified geometry or NULL.
x_return
y_return Return the x and y offsets.
width_return
height_return
Return the width and height determined.
w Specifies the window.
window_name
Specifies the window name, which should be a
null-terminated string.
wm_hints Specifies the XWMHints structure to be used.
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).
If the window_name argument is non-null, XSetWMProperties
calls XSetWMName, which, in turn, sets the WM_NAME property
(see section 9.1.4). If the icon_name argument is non-null,
XSetWMProperties calls XSetWMIconName, which sets the
WM_ICON_NAME property (see section 9.1.5). If the argv
argument is non-null, XSetWMProperties calls XSetCommand,
which sets the WM_COMMAND property (see section 9.2.1).
Note that an argc of 0 is allowed to indicate a zero-length
command. Note also that the hostname of this machine is
stored using XSetWMClientMachine (see section 9.2.2).
If the normal_hints argument is non-null, XSetWMProperties
calls XSetWMNormalHints, which sets the WM_NORMAL_HINTS pro-
perty (see section 9.1.7). If the wm_hints argument is
non-null, XSetWMProperties calls XSetWMHints, which sets the
WM_HINTS property (see section 9.1.6).
If the class_hints argument is non-null, XSetWMProperties
calls XSetClassHint, which sets the WM_CLASS property (see
section 9.1.8). If the res_name member in the XClassHint
Release 4 Page 2 Printed 1/24/91
XSetWMProperties(3X11RISC/os Reference ManuXSetWMProperties(3X11)
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, 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.
The XWMGeometry function combines any geometry information
(given in the format used by XParseGeometry) specified by
the user and by the calling program with size hints (usually
the ones to be stored in WM_NORMAL_HINTS) and returns the
position, size, and gravity (NorthWestGravity, NorthEast-
Gravity, SouthEastGravity or SouthWestGravity) that describe
the window. If the base size is not set in the XSizeHints
structure, the minimum size is used if set. Otherwise, a
base size of 0 is assumed. If no minimum size is set in the
hints structure, the base size is used. A mask (in the form
returned by XParseGeometry) that describes which values came
from the user specification and whether or not the position
coordinates are relative to the right and bottom edges is
returned (which will have already been accounted for in the
x_return and y_return values).
Note that invalid geometry specifications can cause a width
or height of 0 to be returned. The caller may pass the
address of the hints win_gravity field as gravity_return to
update the hints directly.
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, separated by ASCII
nulls, used to invoke the application.
WM_HINTS Additional hints set by client for use by the win-
dow manager. The C type of this property is
XWMHints.
WM_ICON_NAME
Name to be used in icon.
WM_NAME Name of the application.
Printed 1/24/91 Release 4 Page 3
XSetWMProperties(3X11RISC/os Reference ManuXSetWMProperties(3X11)
WM_NORMAL_HINTS
Size hints for a window in its normal state. The
C type of this property is XSizeHints.
DIAGNOSTICS
BadAlloc The server failed to allocate the requested
resource or server memory.
BadWindow A value for a Window argument does not name a
defined Window.
SEE ALSO
XAllocClassHint(3X11), XAllocIconSize(3X11),
XAllocSizeHints(3X11), XAllocWMHints(3X11),
XParseGeometry(3X11), XSetCommand(3X11),
XSetTransientForHint(3X11), XSetTextProperty(3X11),
XSetWMClientMachine(3X11), XSetWMColormapWindows(3X11),
XSetWMIconName(3X11), XSetWMName(3X11),
XSetWMProtocols(3X11), XStringListToTextProperty(3X11)
Xlib - C Language X Interface
Release 4 Page 4 Printed 1/24/91