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

DIAGNOSTICS

141       BadAlloc  The server failed  to  allocate  the  requested  resource  or
142                 server memory.
143
144       BadWindow A value for a Window argument does not name a defined Window.
145

SEE ALSO

147       XAllocClassHint(3),  XAllocIconSize(3),  XAllocSizeHints(3),  XFree(3),
148       XSetCommand(3), XSetTransientForHint(3),  XSetTextProperty(3),  XSetWM‐
149       ClientMachine(3),  XSetWMColormapWindows(3), XSetWMIconName(3), XSetWM‐
150       Name(3),   XSetWMProperties(3),   XSetWMProtocols(3),    XStringListTo‐
151       TextProperty(3)
152       Xlib  -  C  Language  X Interface, O'Reilly and Associates, Sebastopol,
153       1991.
154
155
156
157X Version 11                     libX11 1.8.7                 XAllocWMHints(3)
Impressum