1XAllocSizeHints(3) XLIB FUNCTIONS XAllocSizeHints(3)
2
3
4
6 XAllocSizeHints, XSetWMNormalHints, XGetWMNormalHints, XSetWMSizeHints,
7 XGetWMSizeHints, XSizeHints - allocate size hints structure and set or
8 read a window's WM_NORMAL_HINTS property
9
11 XSizeHints *XAllocSizeHints(void);
12
13 void XSetWMNormalHints(Display *display, Window w, XSizeHints *hints);
14
15 Status XGetWMNormalHints(Display *display, Window w, XSizeHints
16 *hints_return, long *supplied_return);
17
18 void XSetWMSizeHints(Display *display, Window w, XSizeHints *hints,
19 Atom property);
20
21 Status XGetWMSizeHints(Display *display, Window w, XSizeHints
22 *hints_return, long *supplied_return, Atom property);
23
25 display Specifies the connection to the X server.
26
27 hints Specifies the size hints for the window in its normal state.
28
29 hints Specifies the XSizeHints structure to be used.
30
31 hints_return
32 Returns the size hints for the window in its normal state.
33
34 property Specifies the property name.
35
36 supplied_return
37 Returns the hints that were supplied by the user.
38
39 w Specifies the window.
40
42 The XAllocSizeHints function allocates and returns a pointer to a
43 XSizeHints structure. Note that all fields in the XSizeHints structure
44 are initially set to zero. If insufficient memory is available, XAl‐
45 locSizeHints returns NULL. To free the memory allocated to this struc‐
46 ture, use XFree.
47
48 The XSetWMNormalHints function replaces the size hints for the WM_NOR‐
49 MAL_HINTS property on the specified window. If the property does not
50 already exist, XSetWMNormalHints sets the size hints for the WM_NOR‐
51 MAL_HINTS property on the specified window. The property is stored
52 with a type of WM_SIZE_HINTS and a format of 32.
53
54 XSetWMNormalHints can generate BadAlloc and BadWindow errors.
55
56 The XGetWMNormalHints function returns the size hints stored in the
57 WM_NORMAL_HINTS property on the specified window. If the property is
58 of type WM_SIZE_HINTS, is of format 32, and is long enough to contain
59 either an old (pre-ICCCM) or new size hints structure, XGetWMNormal‐
60 Hints sets the various fields of the XSizeHints structure, sets the
61 supplied_return argument to the list of fields that were supplied by
62 the user (whether or not they contained defined values), and returns a
63 nonzero status. Otherwise, it returns a zero status.
64
65 If XGetWMNormalHints returns successfully and a pre-ICCCM size hints
66 property is read, the supplied_return argument will contain the follow‐
67 ing bits:
68
69 (USPosition|USSize|PPosition|PSize|PMinSize|
70 PMaxSize|PResizeInc|PAspect)
71
72 If the property is large enough to contain the base size and window
73 gravity fields as well, the supplied_return argument will also contain
74 the following bits:
75
76 PBaseSize|PWinGravity
77
78 XGetWMNormalHints can generate a PN BadWindow error.
79
80 The XSetWMSizeHints function replaces the size hints for the specified
81 property on the named window. If the specified property does not al‐
82 ready exist, XSetWMSizeHints sets the size hints for the specified
83 property on the named window. The property is stored with a type of
84 WM_SIZE_HINTS and a format of 32. To set a window's normal size hints,
85 you can use the XSetWMNormalHints function.
86
87 XSetWMSizeHints can generate BadAlloc, BadAtom, and BadWindow errors.
88
89 The XGetWMSizeHints function returns the size hints stored in the spec‐
90 ified property on the named window. If the property is of type
91 WM_SIZE_HINTS, is of format 32, and is long enough to contain either an
92 old (pre-ICCCM) or new size hints structure, XGetWMSizeHints sets the
93 various fields of the XSizeHints structure, sets the supplied_return
94 argument to the list of fields that were supplied by the user (whether
95 or not they contained defined values), and returns a nonzero status.
96 Otherwise, it returns a zero status. To get a window's normal size
97 hints, you can use the XGetWMNormalHints function.
98
99 If XGetWMSizeHints returns successfully and a pre-ICCCM size hints
100 property is read, the supplied_return argument will contain the follow‐
101 ing bits:
102
103 (USPosition|USSize|PPosition|PSize|PMinSize|
104 PMaxSize|PResizeInc|PAspect)
105
106 If the property is large enough to contain the base size and window
107 gravity fields as well, the supplied_return argument will also contain
108 the following bits:
109
110 PBaseSize|PWinGravity
111
112 XGetWMSizeHints can generate BadAtom and BadWindow errors.
113
115 WM_NORMAL_HINTS
116 Size hints for a window in its normal state. The C type of
117 this property is XSizeHints.
118
120 The XSizeHints structure contains:
121
122 /* Size hints mask bits */
123
124 #de‐ USPosition (1L << 0) /* user specified x, y */
125 fine
126 #de‐ USSize (1L << 1) /* user specified width,
127 fine height */
128 #de‐ PPosition (1L << 2) /* program specified posi‐
129 fine tion */
130 #de‐ PSize (1L << 3) /* program specified size */
131 fine
132
133 #de‐ PMinSize (1L << 4) /* program specified minimum
134 fine size */
135 #de‐ PMaxSize (1L << 5) /* program specified maximum
136 fine size */
137 #de‐ PResizeInc (1L << 6) /* program specified resize
138 fine increments */
139 #de‐ PAspect (1L << 7) /* program specified min and
140 fine max aspect ratios */
141 #de‐ PBaseSize (1L << 8)
142 fine
143 #de‐ PWinGrav‐ (1L << 9)
144 fine ity
145 #de‐ PAllHints (PPosition|
146 fine PSize|
147 PMinSize|
148 PMaxSize|
149 PRe‐
150 sizeInc|
151 PAspect)
152 /* Values */
153
154 typedef struct {
155 long flags; /* marks which fields in this structure are defined */
156 int x, y; /* Obsolete */
157 int width, height; /* Obsolete */
158 int min_width, min_height;
159 int max_width, max_height;
160 int width_inc, height_inc;
161 struct {
162 int x; /* numerator */
163 int y; /* denominator */
164 } min_aspect, max_aspect;
165 int base_width, base_height;
166 int win_gravity;
167 /* this structure may be extended in the future */
168 } XSizeHints;
169
170 The x, y, width, and height members are now obsolete and are left
171 solely for compatibility reasons. The min_width and min_height members
172 specify the minimum window size that still allows the application to be
173 useful. The max_width and max_height members specify the maximum win‐
174 dow size. The width_inc and height_inc members define an arithmetic
175 progression of sizes (minimum to maximum) into which the window prefers
176 to be resized. The min_aspect and max_aspect members are expressed as
177 ratios of x and y, and they allow an application to specify the range
178 of aspect ratios it prefers. The base_width and base_height members
179 define the desired size of the window. The window manager will inter‐
180 pret the position of the window and its border width to position the
181 point of the outer rectangle of the overall window specified by the
182 win_gravity member. The outer rectangle of the window includes any
183 borders or decorations supplied by the window manager. In other words,
184 if the window manager decides to place the window where the client
185 asked, the position on the parent window's border named by the
186 win_gravity will be placed where the client window would have been
187 placed in the absence of a window manager.
188
189 Note that use of the PAllHints macro is highly discouraged.
190
192 BadAlloc The server failed to allocate the requested resource or
193 server memory.
194
195 BadAtom A value for an Atom argument does not name a defined Atom.
196
197 BadWindow A value for a Window argument does not name a defined Window.
198
200 XAllocClassHint(3), XAllocIconSize(3), XAllocWMHints(3), XFree(3),
201 XSetCommand(3), XSetTransientForHint(3), XSetTextProperty(3), XSetWM‐
202 ClientMachine(3), XSetWMColormapWindows(3), XSetWMIconName(3), XSetWM‐
203 Name(3), XSetWMProperties(3), XSetWMProtocols(3), XStringListTo‐
204 TextProperty(3)
205 Xlib - C Language X Interface, O'Reilly and Associates,
206
207
208
209X Version 11 libX11 1.8.7 XAllocSizeHints(3)