1XAllocWMHints(3X11) XLIB FUNCTIONS XAllocWMHints(3X11)
2
3
4
51991.
6
8 XAllocWMHints, XSetWMHints, XGetWMHints, XWMHints - allocate window
9 manager hints structure and set or read a window's WM_HINTS property
10
12 XWMHints *XAllocWMHints(void);
13
14 int XSetWMHints(Display *display, Window w, XWMHints *wmhints);
15
16 XWMHints *XGetWMHints(Display *display, Window w);
17
19 display Specifies the connection to the X server.
20
21 w Specifies the window.
22
23 wmhints Specifies the XWMHints structure to be used.
24
26 The XAllocWMHints function allocates and returns a pointer to a
27 XWMHints structure. Note that all fields in the XWMHints structure are
28 initially set to zero. If insufficient memory is available, XAl‐
29 locWMHints returns NULL. To free the memory allocated to this struc‐
30 ture, use XFree.
31
32 The XSetWMHints function sets the window manager hints that include
33 icon information and location, the initial state of the window, and
34 whether the application relies on the window manager to get keyboard
35 input.
36
37 XSetWMHints can generate BadAlloc and BadWindow errors.
38
39 The XGetWMHints function reads the window manager hints and returns
40 NULL if no WM_HINTS property was set on the window or returns a pointer
41 to a XWMHints structure if it succeeds. When finished with the data,
42 free the space used for it by calling XFree.
43
44 XGetWMHints can generate a BadWindow error.
45
47 WM_HINTS Additional hints set by the client for use by the window man‐
48 ager. The C type of this property is XWMHints.
49
51 The XWMHints structure contains:
52
53 /∗ Window manager hints mask bits */
54
55 #define InputHint (1L << 0)
56 #define StateHint (1L << 1)
57 #define IconPixmapHint (1L << 2)
58 #define IconWindowHint (1L << 3)
59 #define IconPositionHint (1L << 4)
60 #define IconMaskHint (1L << 5)
61 #define WindowGroupHint (1L << 6)
62 #define UrgencyHint (1L << 8)
63
64
65
66
67 #define AllHints (InputHint|State‐
68 Hint|IconPixmapHint|
69 IconWindowHint|IconPosi‐
70 tionHint|
71 IconMaskHint|Window‐
72 GroupHint)
73 /∗ Values */
74
75 typedef struct {
76 long flags; /∗ marks which fields in this structure are defined */
77 Bool input; /∗ does this application rely on the window manager to
78 get keyboard input? */
79 int initial_state; /∗ see below */
80 Pixmap icon_pixmap; /∗ pixmap to be used as icon */
81 Window icon_window; /∗ window to be used as icon */
82 int icon_x, icon_y; /∗ initial position of icon */
83 Pixmap icon_mask; /∗ pixmap to be used as mask for icon_pixmap */
84 XID window_group; /∗ id of related window group */
85 /∗ this structure may be extended in the future */
86 } XWMHints;
87
88 The input member is used to communicate to the window manager the input
89 focus model used by the application. Applications that expect input
90 but never explicitly set focus to any of their subwindows (that is, use
91 the push model of focus management), such as X Version 10 style appli‐
92 cations that use real-estate driven focus, should set this member to
93 True. Similarly, applications that set input focus to their subwindows
94 only when it is given to their top-level window by a window manager
95 should also set this member to True. Applications that manage their
96 own input focus by explicitly setting focus to one of their subwindows
97 whenever they want keyboard input (that is, use the pull model of focus
98 management) should set this member to False. Applications that never
99 expect any keyboard input also should set this member to False.
100
101 Pull model window managers should make it possible for push model
102 applications to get input by setting input focus to the top-level win‐
103 dows of applications whose input member is True. Push model window
104 managers should make sure that pull model applications do not break
105 them by resetting input focus to PointerRoot when it is appropriate
106 (for example, whenever an application whose input member is False sets
107 input focus to one of its subwindows).
108
109 The definitions for the initial_state flag are:
110
111 #define WithdrawnState 0
112 #define NormalState 1 /∗ most applications start
113 this way */
114 #define IconicState 3 /∗ application wants to
115 start as an 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
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
141 XAllocClassHint(3X11), XAllocIconSize(3X11), XAllocSizeHints(3X11),
142 XFree(3X11), XSetCommand(3X11), XSetTransientForHint(3X11), XSet‐
143 TextProperty(3X11), XSetWMClientMachine(3X11), XSetWMColormapWin‐
144 dows(3X11), XSetWMIconName(3X11), XSetWMName(3X11), XSetWMProper‐
145 ties(3X11), XSetWMProtocols(3X11), XStringListToTextProperty(3X11)
146 Xlib - C Language X Interface, O'Reilly and Associates, Sebastopol,
147
148
149
150X Version 11 libX11 1.0.3 XAllocWMHints(3X11)