<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
                   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<!-- lifted from troff+man by doclifter -->
<refentry id='xsewmpropman'>
<!--  Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1994, 1996 X Consortium -->
<!--  Copyright \(co 2000  The XFree86 Project, Inc. -->

<!--  Permission is hereby granted, free of charge, to any person obtaining -->
<!--  a copy of this software and associated documentation files (the -->
<!--  "Software"), to deal in the Software without restriction, including -->
<!--  without limitation the rights to use, copy, modify, merge, publish, -->
<!--  distribute, sublicense, and/or sell copies of the Software, and to -->
<!--  permit persons to whom the Software is furnished to do so, subject to -->
<!--  the following conditions: -->

<!--  The above copyright notice and this permission notice shall be included -->
<!--  in all copies or substantial portions of the Software. -->

<!--  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -->
<!--  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -->
<!--  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -->
<!--  IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR -->
<!--  OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -->
<!--  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -->
<!--  OTHER DEALINGS IN THE SOFTWARE. -->

<!--  Except as contained in this notice, the name of the X Consortium shall -->
<!--  not be used in advertising or otherwise to promote the sale, use or -->
<!--  other dealings in this Software without prior written authorization -->
<!--  from the X Consortium. -->

<!--  Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991 by -->
<!--  Digital Equipment Corporation -->

<!--  Portions Copyright \(co 1990, 1991 by -->
<!--  Tektronix, Inc. -->

<!--  Permission to use, copy, modify and distribute this documentation for -->
<!--  any purpose and without fee is hereby granted, provided that the above -->
<!--  copyright notice appears in all copies and that both that copyright notice -->
<!--  and this permission notice appear in all copies, and that the names of -->
<!--  Digital and Tektronix not be used in in advertising or publicity pertaining -->
<!--  to this documentation without specific, written prior permission. -->
<!--  Digital and Tektronix makes no representations about the suitability -->
<!--  of this documentation for any purpose. -->
<!--  It is provided ``as is'' without express or implied warranty. -->

<!--  $XFree86: xc/doc/man/X11/XSeWMProp.man,v 1.5 2003/04/28 22:17:57 herrb Exp $ -->
<!--   -->
<!-- .na -->
<!-- Ds listing suppressed (not used) -->
<!-- De listing suppressed (not used) -->
<!-- FD listing suppressed (not used) -->
<!-- FN listing suppressed (not used) -->
<!-- IN listing suppressed (not used) -->
<!-- C{ listing suppressed (not used) -->
<!-- C} listing suppressed (not used) -->
<!-- Pn listing suppressed (not used) -->
<!-- hN listing suppressed (not used) -->
<!-- NT listing suppressed (not used) -->
<!-- .		\" Note End \-\- doug kraft 3/85 -->
<!-- NE listing suppressed (not used) -->
<!-- .ny0 -->
<refmeta>
<refentrytitle>XSetWMProperties</refentrytitle>
<manvolnum>3X11</manvolnum>
<refmiscinfo class='date'>__xorgversion__</refmiscinfo>
<refmiscinfo class='source'>XLIB FUNCTIONS</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>XSetWMProperties</refname>
<refname>XmbSetWMProperties</refname>
<refname>Xutf8SetWMProperties</refname>
<refpurpose>set standard window properties</refpurpose>
</refnamediv>
<!-- body begins here -->

<refsect1 id='syntax'><title>SYNTAX</title>

<para>void XSetWMProperties&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>&hairsp;, Window <emphasis remap='I'>w</emphasis>&hairsp;,
XTextProperty *<emphasis remap='I'>window_name</emphasis>&hairsp;, XTextProperty *<emphasis remap='I'>icon_name</emphasis>&hairsp;, char
**<emphasis remap='I'>argv</emphasis>&hairsp;, int <emphasis remap='I'>argc</emphasis>&hairsp;, XSizeHints *<emphasis remap='I'>normal_hints</emphasis>&hairsp;, XWMHints
*<emphasis remap='I'>wm_hints</emphasis>&hairsp;, XClassHint *<emphasis remap='I'>class_hints</emphasis>&hairsp;);</para> 

<para>void XmbSetWMProperties&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>&hairsp;, Window <emphasis remap='I'>w</emphasis>&hairsp;, char
*<emphasis remap='I'>window_name</emphasis>&hairsp;, char *<emphasis remap='I'>icon_name</emphasis>&hairsp;, char *<emphasis remap='I'>argv</emphasis>&hairsp;[], int
<emphasis remap='I'>argc</emphasis>&hairsp;, XSizeHints *<emphasis remap='I'>normal_hints</emphasis>&hairsp;, XWMHints *<emphasis remap='I'>wm_hints</emphasis>&hairsp;,
XClassHint *<emphasis remap='I'>class_hints</emphasis>&hairsp;);</para> 

<para>void Xutf8SetWMProperties&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>&hairsp;, Window <emphasis remap='I'>w</emphasis>&hairsp;, char
*<emphasis remap='I'>window_name</emphasis>&hairsp;, char *<emphasis remap='I'>icon_name</emphasis>&hairsp;, char *<emphasis remap='I'>argv</emphasis>&hairsp;[], int
<emphasis remap='I'>argc</emphasis>&hairsp;, XSizeHints *<emphasis remap='I'>normal_hints</emphasis>&hairsp;, XWMHints *<emphasis remap='I'>wm_hints</emphasis>&hairsp;,
XClassHint *<emphasis remap='I'>class_hints</emphasis>&hairsp;);</para> 
</refsect1>

<refsect1 id='arguments'><title>ARGUMENTS</title>
<variablelist remap='IP'>
  <varlistentry>
  <term><emphasis remap='I'>argc</emphasis></term>
  <listitem>
<para>Specifies the number of arguments.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>argv</emphasis></term>
  <listitem>
<para>Specifies the application's argument list.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>class_hints</emphasis></term>
  <listitem>
<para>Specifies the
<emphasis remap='I'>&hairsp;XClassHint&hairsp;</emphasis>
structure to be used.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>display</emphasis></term>
  <listitem>
<para>Specifies the connection to the X server.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>icon_name</emphasis></term>
  <listitem>
<para>Specifies the icon name,
which should be a null-terminated string.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>normal_hints</emphasis></term>
  <listitem>
<para>Specifies the size hints for the window in its normal state.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>w</emphasis></term>
  <listitem>
<para>Specifies the window.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>window_name</emphasis></term>
  <listitem>
<para>Specifies the window name,
which should be a null-terminated string.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>wm_hints</emphasis></term>
  <listitem>
<para>Specifies the
<emphasis remap='I'>&hairsp;XWMHints&hairsp;</emphasis>
structure to be used.</para>
  </listitem>
  </varlistentry>
</variablelist>
</refsect1>

<refsect1 id='description'><title>DESCRIPTION</title>
<para>The 
<emphasis remap='I'>&hairsp;XSetWMProperties&hairsp;</emphasis>
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).</para>

<para>If the window_name argument is non-NULL, 
<emphasis remap='I'>&hairsp;XSetWMProperties&hairsp;</emphasis>
calls
<emphasis remap='I'>&hairsp;XSetWMName&hairsp;</emphasis>,
which in turn, sets the WM_NAME property (see section 14.1.4).
If the icon_name argument is non-NULL,
<emphasis remap='I'>&hairsp;XSetWMProperties&hairsp;</emphasis>
calls
<emphasis remap='I'>&hairsp;XSetWMIconName&hairsp;</emphasis>,
which sets the WM_ICON_NAME property (see section 14.1.5).
If the argv argument is non-NULL, 
<emphasis remap='I'>&hairsp;XSetWMProperties&hairsp;</emphasis>
calls
<emphasis remap='I'>&hairsp;XSetCommand&hairsp;</emphasis>,
which sets the WM_COMMAND property (see section 14.2.1).
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
<emphasis remap='I'>&hairsp;XSetWMClientMachine&hairsp;</emphasis>
(see section 14.2.2).</para>

<para>If the normal_hints argument is non-NULL, 
<emphasis remap='I'>&hairsp;XSetWMProperties&hairsp;</emphasis>
calls
<emphasis remap='I'>&hairsp;XSetWMNormalHints&hairsp;</emphasis>,
which sets the WM_NORMAL_HINTS property (see section 14.1.7).
If the wm_hints argument is non-NULL, 
<emphasis remap='I'>&hairsp;XSetWMProperties&hairsp;</emphasis>
calls
<emphasis remap='I'>&hairsp;XSetWMHints&hairsp;</emphasis>,
which sets the WM_HINTS property (see section 14.1.6).</para>

<para>If the class_hints argument is non-NULL, 
<emphasis remap='I'>&hairsp;XSetWMProperties&hairsp;</emphasis>
calls
<emphasis remap='I'>&hairsp;XSetClassHint&hairsp;</emphasis>,
which sets the WM_CLASS property (see section 14.1.8).
If the res_name member in the
<emphasis remap='I'>&hairsp;XClassHint&hairsp;</emphasis>
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.</para>

<para>The
<emphasis remap='I'>&hairsp;XmbSetWMProperties&hairsp;</emphasis>
and
<emphasis remap='I'>&hairsp;Xutf8SetWMProperties&hairsp;</emphasis>
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).</para>

<para>If the window_name argument is non-NULL,
they set the WM_NAME property.
If the icon_name argument is non-NULL,
they set the WM_ICON_NAME property.
The window_name and icon_name arguments are null-terminated strings, for
<emphasis remap='I'>&hairsp;XmbSetWMProperties&hairsp;</emphasis>
in the encoding of the current locale, for
<emphasis remap='I'>&hairsp;Xutf8SetWMProperties&hairsp;</emphasis>
in UTF-8 encoding.
If the arguments can be fully converted to the STRING encoding,
the properties are created with type &ldquo;STRING&rdquo;; 
otherwise, the arguments are converted to Compound Text, 
and the properties are created with type &ldquo;COMPOUND_TEXT&rdquo;.</para>

<para>If the normal_hints argument is non-NULL,
<emphasis remap='I'>&hairsp;XmbSetWMProperties&hairsp;</emphasis>
and
<emphasis remap='I'>&hairsp;Xutf8SetWMProperties&hairsp;</emphasis>
call
<emphasis remap='I'>&hairsp;XSetWMNormalHints&hairsp;</emphasis>,
which sets the WM_NORMAL_HINTS property (see section 14.1.7).
If the wm_hints argument is non-NULL, 
<emphasis remap='I'>&hairsp;XmbSetWMProperties&hairsp;</emphasis>
and
<emphasis remap='I'>&hairsp;Xutf8SetWMProperties&hairsp;</emphasis>
call
<emphasis remap='I'>&hairsp;XSetWMHints&hairsp;</emphasis>,
which sets the WM_HINTS property (see section 14.1.6).</para>

<para>If the argv argument is non-NULL,
<emphasis remap='I'>&hairsp;XmbSetWMProperties&hairsp;</emphasis>
and
<emphasis remap='I'>&hairsp;Xutf8SetWMProperties&hairsp;</emphasis>
set the WM_COMMAND property from argv and argc.
An argc of zero indicates a zero-length command.</para>

<para>The hostname of the machine is stored using 
<emphasis remap='I'>&hairsp;XSetWMClientMachine&hairsp;</emphasis>
(see section 14.2.2).</para>

<para>If the class_hints argument is non-NULL,
<emphasis remap='I'>&hairsp;XmbSetWMProperties&hairsp;</emphasis>
and
<emphasis remap='I'>&hairsp;Xutf8SetWMProperties&hairsp;</emphasis>
set the WM_CLASS property.
If the res_name member in the 
<emphasis remap='I'>&hairsp;XClassHint&hairsp;</emphasis>
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.</para>

<para>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.</para>

<para>For clients that need to process the property text in a locale,
<emphasis remap='I'>&hairsp;XmbSetWMProperties&hairsp;</emphasis>
and
<emphasis remap='I'>&hairsp;Xutf8SetWMProperties&hairsp;</emphasis>
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.</para>

<para><emphasis remap='I'>&hairsp;XSetWMProperties&hairsp;</emphasis>,
<emphasis remap='I'>&hairsp;XmbSetWMProperties&hairsp;</emphasis>
and
<emphasis remap='I'>&hairsp;Xutf8SetWMProperties&hairsp;</emphasis>
can generate
<emphasis remap='I'>&hairsp;BadAlloc&hairsp;</emphasis>
and
<emphasis remap='I'>&hairsp;BadWindow&hairsp;</emphasis>
errors.</para>

<para>The function
<emphasis remap='I'>&hairsp;Xutf8SetWMProperties&hairsp;</emphasis>
is an XFree86 extension introduced in XFree86 4.0.2. Its presence is
indicated by the macro
<emphasis remap='I'>&hairsp;X_HAVE_UTF8_STRING&hairsp;</emphasis>.</para>
</refsect1>

<refsect1 id='properties'><title>PROPERTIES</title>
<variablelist remap='TP'>
  <varlistentry>
  <term>WM_CLASS</term>
  <listitem>
<para>Set by application programs to allow window and session
managers to obtain the application's resources from the resource database.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term>WM_CLIENT_MACHINE</term>
  <listitem>
<para>The string name of the machine on which the client application is running.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term>WM_COMMAND</term>
  <listitem>
<para>The command and arguments, null-separated, used to invoke the
application.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term>WM_HINTS</term>
  <listitem>
<para>Additional hints set by the client for use by the window manager.
The C type of this property is 
<emphasis remap='I'>&hairsp;XWMHints&hairsp;</emphasis>.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term>WM_ICON_NAME</term>
  <listitem>
<para>The name to be used in an icon.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term>WM_NAME</term>
  <listitem>
<para>The name of the application.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term>WM_NORMAL_HINTS</term>
  <listitem>
<para>Size hints for a window in its normal state.
The C type of this property is
<emphasis remap='I'>&hairsp;XSizeHints&hairsp;</emphasis>.</para>
  </listitem>
  </varlistentry>
</variablelist>
</refsect1>

<refsect1 id='diagnostics'><title>DIAGNOSTICS</title>
<variablelist remap='TP'>
  <varlistentry>
  <term><emphasis remap='I'>&hairsp;BadAlloc&hairsp;</emphasis></term>
  <listitem>
<para>The server failed to allocate the requested resource or server memory.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>&hairsp;BadWindow&hairsp;</emphasis></term>
  <listitem>
<para>A value for a Window argument does not name a defined Window.</para>
  </listitem>
  </varlistentry>
</variablelist>
</refsect1>

<refsect1 id='see_also'><title>SEE ALSO</title>
<para>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),
XTextListToTextProperty(3X11)
<!-- .br -->
<userinput>Xlib - C Language X Interface</userinput></para>
</refsect1>
</refentry>

