1XAllocWMHints(3)                XLIB FUNCTIONS                XAllocWMHints(3)
2
3
4

NAME

6       XAllocWMHints,  XSetWMHints,  XGetWMHints,  XWMHints  - allocate window
7       manager hints structure and set or read a window's WM_HINTS property
8

SYNTAX

10       XWMHints *XAllocWMHints(void);
11
12       int XSetWMHints(Display *display, Window w, XWMHints *wmhints);
13
14       XWMHints *XGetWMHints(Display *display, Window w);
15

ARGUMENTS

17       display   Specifies the connection to the X server.
18
19       w         Specifies the window.
20
21       wmhints   Specifies the XWMHints structure to be used.
22

DESCRIPTION

24       The XAllocWMHints  function  allocates  and  returns  a  pointer  to  a
25       XWMHints structure.  Note that all fields in the XWMHints structure are
26       initially set to zero.   If  insufficient  memory  is  available,  XAl‐
27       locWMHints  returns  NULL.  To free the memory allocated to this struc‐
28       ture, use XFree.
29
30       The XSetWMHints function sets the window  manager  hints  that  include
31       icon  information  and  location,  the initial state of the window, and
32       whether the application relies on the window manager  to  get  keyboard
33       input.
34
35       XSetWMHints can generate BadAlloc and BadWindow errors.
36
37       The  XGetWMHints  function  reads  the window manager hints and returns
38       NULL if no WM_HINTS property was set on the window or returns a pointer
39       to  a  XWMHints structure if it succeeds.  When finished with the data,
40       free the space used for it by calling XFree.
41
42       XGetWMHints can generate a BadWindow error.
43

PROPERTIES

45       WM_HINTS  Additional hints set by the client for use by the window man‐
46                 ager.  The C type of this property is XWMHints.
47

STRUCTURES

49       The XWMHints structure contains:
50
51       /* Window manager hints mask bits */
52
53       #define   InputHint            (1L << 0)
54       #define   StateHint            (1L << 1)
55       #define   IconPixmapHint       (1L << 2)
56       #define   IconWindowHint       (1L << 3)
57       #define   IconPositionHint     (1L << 4)
58       #define   IconMaskHint         (1L << 5)
59       #define   WindowGroupHint      (1L << 6)
60       #define   XUrgencyHint         (1L << 8)
61
62
63
64
65
66
67       #define   AllHints             (InputHint|
68                                       StateHint|
69                                       IconPixmapHint|
70                                       IconWindowHint|
71                                       IconPositionHint|
72                                       IconMaskHint|
73                                       WindowGroupHint)
74       /* Values */
75
76       typedef struct {
77               long flags;     /* marks which fields in this structure are defined */
78               Bool input;     /* does this application rely on the window manager to
79                               get keyboard input? */
80               int initial_state;      /* see below */
81               Pixmap icon_pixmap;     /* pixmap to be used as icon */
82               Window icon_window;     /* window to be used as icon */
83               int icon_x, icon_y;     /* initial position of icon */
84               Pixmap icon_mask;       /* pixmap to be used as mask for icon_pixmap */
85               XID window_group;       /* id of related window group */
86               /* this structure may be extended in the future */
87       } XWMHints;
88
89       The input member is used to communicate to the window manager the input
90       focus  model  used  by the application.  Applications that expect input
91       but never explicitly set focus to any of their subwindows (that is, use
92       the  push model of focus management), such as X Version 10 style appli‐
93       cations that use real-estate driven focus, should set  this  member  to
94       True.  Similarly, applications that set input focus to their subwindows
95       only when it is given to their top-level window  by  a  window  manager
96       should  also  set  this member to True.  Applications that manage their
97       own input focus by explicitly setting focus to one of their  subwindows
98       whenever they want keyboard input (that is, use the pull model of focus
99       management) should set this member to False.  Applications  that  never
100       expect any keyboard input also should set this member to False.
101
102       Pull  model  window  managers  should  make  it possible for push model
103       applications to get input by setting input focus to the top-level  win‐
104       dows  of  applications  whose  input member is True.  Push model window
105       managers should make sure that pull model  applications  do  not  break
106       them  by  resetting  input  focus to PointerRoot when it is appropriate
107       (for example, whenever an application whose input member is False  sets
108       input focus to one of its subwindows).
109
110       The definitions for the initial_state flag are:
111
112       #define   WithdrawnState    0
113       #define   NormalState       1   /* most applications start this way */
114       #define   IconicState       3   /* application wants  to  start  as  an
115                                       icon */
116       The  icon_mask specifies which pixels of the icon_pixmap should be used
117       as the icon.  This allows for nonrectangular icons.   Both  icon_pixmap
118       and  icon_mask  must  be  bitmaps.  The icon_window lets an application
119       provide a window for use as an icon for window  managers  that  support
120       such  use.   The window_group lets you specify that this window belongs
121       to a group of other windows.  For  example,  if  a  single  application
122       manipulates  multiple  top-level  windows,  this  allows you to provide
123       enough information that a window manager can iconify all of the windows
124       rather than just the one window.
125
126       The  UrgencyHint  flag,  if  set in the flags field, indicates that the
127       client deems the window contents to be  urgent,  requiring  the  timely
128       response of the user.  The window manager will make some effort to draw
129       the user's attention to this window while this flag is set.  The client
130       must provide some means by which the user can cause the urgency flag to
131       be cleared (either mitigating the condition that made the window urgent
132       or merely shutting off the alarm) or the window to be withdrawn.
133

DIAGNOSTICS

135       BadAlloc  The  server  failed  to  allocate  the  requested resource or
136                 server memory.
137
138       BadWindow A value for a Window argument does not name a defined Window.
139

SEE ALSO

141       XAllocClassHint(3),  XAllocIconSize(3),  XAllocSizeHints(3),  XFree(3),
142       XSetCommand(3),  XSetTransientForHint(3),  XSetTextProperty(3), XSetWM‐
143       ClientMachine(3), XSetWMColormapWindows(3), XSetWMIconName(3),  XSetWM‐
144       Name(3),    XSetWMProperties(3),   XSetWMProtocols(3),   XStringListTo‐
145       TextProperty(3)
146       Xlib - C Language X Interface,  O'Reilly  and  Associates,  Sebastopol,
147       1991.
148
149
150
151X Version 11                     libX11 1.6.12                XAllocWMHints(3)
Impressum