upload tizen2.0 source
[framework/uifw/xorg/lib/libx11.git] / man / XGrabPointer.man
1 .\" Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1994, 1996 X Consortium
2 .\"
3 .\" Permission is hereby granted, free of charge, to any person obtaining
4 .\" a copy of this software and associated documentation files (the
5 .\" "Software"), to deal in the Software without restriction, including
6 .\" without limitation the rights to use, copy, modify, merge, publish,
7 .\" distribute, sublicense, and/or sell copies of the Software, and to
8 .\" permit persons to whom the Software is furnished to do so, subject to
9 .\" the following conditions:
10 .\"
11 .\" The above copyright notice and this permission notice shall be included
12 .\" in all copies or substantial portions of the Software.
13 .\"
14 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 .\" IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 .\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 .\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 .\" OTHER DEALINGS IN THE SOFTWARE.
21 .\"
22 .\" Except as contained in this notice, the name of the X Consortium shall
23 .\" not be used in advertising or otherwise to promote the sale, use or
24 .\" other dealings in this Software without prior written authorization
25 .\" from the X Consortium.
26 .\"
27 .\" Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991 by
28 .\" Digital Equipment Corporation
29 .\"
30 .\" Portions Copyright \(co 1990, 1991 by
31 .\" Tektronix, Inc.
32 .\"
33 .\" Permission to use, copy, modify and distribute this documentation for
34 .\" any purpose and without fee is hereby granted, provided that the above
35 .\" copyright notice appears in all copies and that both that copyright notice
36 .\" and this permission notice appear in all copies, and that the names of
37 .\" Digital and Tektronix not be used in in advertising or publicity pertaining
38 .\" to this documentation without specific, written prior permission.
39 .\" Digital and Tektronix makes no representations about the suitability
40 .\" of this documentation for any purpose.
41 .\" It is provided ``as is'' without express or implied warranty.
42 .\" 
43 .\"
44 .ds xT X Toolkit Intrinsics \- C Language Interface
45 .ds xW Athena X Widgets \- C Language X Toolkit Interface
46 .ds xL Xlib \- C Language X Interface
47 .ds xC Inter-Client Communication Conventions Manual
48 .na
49 .de Ds
50 .nf
51 .\\$1D \\$2 \\$1
52 .ft 1
53 .\".ps \\n(PS
54 .\".if \\n(VS>=40 .vs \\n(VSu
55 .\".if \\n(VS<=39 .vs \\n(VSp
56 ..
57 .de De
58 .ce 0
59 .if \\n(BD .DF
60 .nr BD 0
61 .in \\n(OIu
62 .if \\n(TM .ls 2
63 .sp \\n(DDu
64 .fi
65 ..
66 .de FD
67 .LP
68 .KS
69 .TA .5i 3i
70 .ta .5i 3i
71 .nf
72 ..
73 .de FN
74 .fi
75 .KE
76 .LP
77 ..
78 .de IN          \" send an index entry to the stderr
79 ..
80 .de C{
81 .KS
82 .nf
83 .D
84 .\"
85 .\"     choose appropriate monospace font
86 .\"     the imagen conditional, 480,
87 .\"     may be changed to L if LB is too
88 .\"     heavy for your eyes...
89 .\"
90 .ie "\\*(.T"480" .ft L
91 .el .ie "\\*(.T"300" .ft L
92 .el .ie "\\*(.T"202" .ft PO
93 .el .ie "\\*(.T"aps" .ft CW
94 .el .ft R
95 .ps \\n(PS
96 .ie \\n(VS>40 .vs \\n(VSu
97 .el .vs \\n(VSp
98 ..
99 .de C}
100 .DE
101 .R
102 ..
103 .de Pn
104 .ie t \\$1\fB\^\\$2\^\fR\\$3
105 .el \\$1\fI\^\\$2\^\fP\\$3
106 ..
107 .de ZN
108 .ie t \fB\^\\$1\^\fR\\$2
109 .el \fI\^\\$1\^\fP\\$2
110 ..
111 .de hN
112 .ie t <\fB\\$1\fR>\\$2
113 .el <\fI\\$1\fP>\\$2
114 ..
115 .de NT
116 .ne 7
117 .ds NO Note
118 .if \\n(.$>$1 .if !'\\$2'C' .ds NO \\$2
119 .if \\n(.$ .if !'\\$1'C' .ds NO \\$1
120 .ie n .sp
121 .el .sp 10p
122 .TB
123 .ce
124 \\*(NO
125 .ie n .sp
126 .el .sp 5p
127 .if '\\$1'C' .ce 99
128 .if '\\$2'C' .ce 99
129 .in +5n
130 .ll -5n
131 .R
132 ..
133 .               \" Note End -- doug kraft 3/85
134 .de NE
135 .ce 0
136 .in -5n
137 .ll +5n
138 .ie n .sp
139 .el .sp 10p
140 ..
141 .ny0
142 .TH XGrabPointer __libmansuffix__ __xorgversion__ "XLIB FUNCTIONS"
143 .SH NAME
144 XGrabPointer, XUngrabPointer, XChangeActivePointerGrab \- grab the pointer
145 .SH SYNTAX
146 .HP
147 int XGrabPointer\^(\^Display *\fIdisplay\fP\^, Window \fIgrab_window\fP\^,
148 Bool \fIowner_events\fP\^, unsigned int \fIevent_mask\fP\^, int
149 \fIpointer_mode\fP\^, int \fIkeyboard_mode\fP\^, Window \fIconfine_to\fP\^,
150 Cursor \fIcursor\fP\^, Time \fItime\fP\^); 
151 .HP
152 int XUngrabPointer\^(\^Display *\fIdisplay\fP\^, Time \fItime\fP\^); 
153 .HP
154 int XChangeActivePointerGrab\^(\^Display *\fIdisplay\fP\^, unsigned int
155 \fIevent_mask\fP\^, Cursor \fIcursor\fP\^, Time \fItime\fP\^); 
156 .SH ARGUMENTS
157 .IP \fIconfine_to\fP 1i
158 Specifies the window to confine the pointer in or
159 .ZN None .
160 .IP \fIcursor\fP 1i
161 Specifies the cursor that is to be displayed during the grab or
162 .ZN None . 
163 .IP \fIdisplay\fP 1i
164 Specifies the connection to the X server.
165 .IP \fIevent_mask\fP 1i
166 Specifies which pointer events are reported to the client.
167 The mask is the bitwise inclusive OR of the valid pointer event mask bits.
168 .IP \fIgrab_window\fP 1i
169 Specifies the grab window.
170 .IP \fIkeyboard_mode\fP 1i
171 Specifies further processing of keyboard events.
172 You can pass 
173 .ZN GrabModeSync 
174 or
175 .ZN GrabModeAsync .
176 .IP \fIowner_events\fP 1i
177 Specifies a Boolean value that indicates whether the pointer 
178 events are to be reported as usual or reported with respect to the grab window 
179 if selected by the event mask.
180 .IP \fIpointer_mode\fP 1i
181 Specifies further processing of pointer events.
182 You can pass 
183 .ZN GrabModeSync 
184 or
185 .ZN GrabModeAsync .
186 .IP \fItime\fP 1i
187 Specifies the time.
188 You can pass either a timestamp or
189 .ZN CurrentTime .
190 .SH DESCRIPTION
191 The
192 .ZN XGrabPointer
193 function actively grabs control of the pointer and returns
194 .ZN GrabSuccess
195 if the grab was successful.
196 Further pointer events are reported only to the grabbing client.
197 .ZN XGrabPointer
198 overrides any active pointer grab by this client.
199 If owner_events is 
200 .ZN False , 
201 all generated pointer events
202 are reported with respect to grab_window and are reported only if
203 selected by event_mask.
204 If owner_events is 
205 .ZN True
206 and if a generated
207 pointer event would normally be reported to this client, 
208 it is reported as usual. 
209 Otherwise, the event is reported with respect to the
210 grab_window and is reported only if selected by event_mask.
211 For either value of owner_events, unreported events are discarded.
212 .LP
213 If the pointer_mode is 
214 .ZN GrabModeAsync , 
215 pointer event processing continues as usual.
216 If the pointer is currently frozen by this client, 
217 the processing of events for the pointer is resumed.
218 If the pointer_mode is 
219 .ZN GrabModeSync , 
220 the state of the pointer, as seen by
221 client applications,
222 appears to freeze, and the X server generates no further pointer events
223 until the grabbing client calls 
224 .ZN XAllowEvents
225 or until the pointer grab is released.
226 Actual pointer changes are not lost while the pointer is frozen;
227 they are simply queued in the server for later processing.
228 .LP
229 If the keyboard_mode is 
230 .ZN GrabModeAsync , 
231 keyboard event processing is unaffected by activation of the grab.
232 If the keyboard_mode is 
233 .ZN GrabModeSync , 
234 the state of the keyboard, as seen by
235 client applications,
236 appears to freeze, and the X server generates no further keyboard events
237 until the grabbing client calls 
238 .ZN XAllowEvents
239 or until the pointer grab is released.
240 Actual keyboard changes are not lost while the pointer is frozen;
241 they are simply queued in the server for later processing.
242 .LP
243 If a cursor is specified, it is displayed regardless of what
244 window the pointer is in.  
245 If 
246 .ZN None
247 is specified,
248 the normal cursor for that window is displayed
249 when the pointer is in grab_window or one of its subwindows;
250 otherwise, the cursor for grab_window is displayed.
251 .LP
252 If a confine_to window is specified,
253 the pointer is restricted to stay contained in that window.
254 The confine_to window need have no relationship to the grab_window.
255 If the pointer is not initially in the confine_to window, 
256 it is warped automatically to the closest edge 
257 just before the grab activates and enter/leave events are generated as usual. 
258 If the confine_to window is subsequently reconfigured, 
259 the pointer is warped automatically, as necessary, 
260 to keep it contained in the window.
261 .LP
262 The time argument allows you to avoid certain circumstances that come up
263 if applications take a long time to respond or if there are long network
264 delays.
265 Consider a situation where you have two applications, both
266 of which normally grab the pointer when clicked on.
267 If both applications specify the timestamp from the event, 
268 the second application may wake up faster and successfully grab the pointer
269 before the first application. 
270 The first application then will get an indication that the other application 
271 grabbed the pointer before its request was processed.
272 .LP
273 .ZN XGrabPointer 
274 generates
275 .ZN EnterNotify 
276 and
277 .ZN LeaveNotify 
278 events.
279 .LP
280 Either if grab_window or confine_to window is not viewable
281 or if the confine_to window lies completely outside the boundaries of the root
282 window,
283 .ZN XGrabPointer
284 fails and returns
285 .ZN GrabNotViewable .
286 If the pointer is actively grabbed by some other client,
287 it fails and returns
288 .ZN AlreadyGrabbed .
289 If the pointer is frozen by an active grab of another client,
290 it fails and returns
291 .ZN GrabFrozen .
292 If the specified time is earlier than the last-pointer-grab time or later 
293 than the current X server time, it fails and returns
294 .ZN GrabInvalidTime .
295 Otherwise, the last-pointer-grab time is set to the specified time
296 .Pn ( CurrentTime 
297 is replaced by the current X server time).
298 .LP
299 .ZN XGrabPointer
300 can generate
301 .ZN BadCursor ,
302 .ZN BadValue ,
303 and
304 .ZN BadWindow 
305 errors.
306 .LP
307 The
308 .ZN XUngrabPointer
309 function releases the pointer and any queued events
310 if this client has actively grabbed the pointer from
311 .ZN XGrabPointer ,
312 .ZN XGrabButton ,
313 or from a normal button press.
314 .ZN XUngrabPointer
315 does not release the pointer if the specified
316 time is earlier than the last-pointer-grab time or is later than the
317 current X server time.
318 It also generates 
319 .ZN EnterNotify 
320 and 
321 .ZN LeaveNotify 
322 events.
323 The X server performs an 
324 .ZN UngrabPointer 
325 request automatically if the event window or confine_to window 
326 for an active pointer grab becomes not viewable
327 or if window reconfiguration causes the confine_to window to lie completely
328 outside the boundaries of the root window.
329 .LP
330 The
331 .ZN XChangeActivePointerGrab
332 function changes the specified dynamic parameters if the pointer is actively
333 grabbed by the client and if the specified time is no earlier than the
334 last-pointer-grab time and no later than the current X server time.
335 This function has no effect on the passive parameters of a
336 .ZN XGrabButton .
337 The interpretation of event_mask and cursor is the same as described in
338 .ZN XGrabPointer .
339 .LP
340 .ZN XChangeActivePointerGrab
341 can generate a
342 .ZN BadCursor 
343 and
344 .ZN BadValue
345 error.
346 .SH DIAGNOSTICS
347 .TP 1i
348 .ZN BadCursor
349 A value for a Cursor argument does not name a defined Cursor.
350 .TP 1i
351 .ZN BadValue
352 Some numeric value falls outside the range of values accepted by the request.
353 Unless a specific range is specified for an argument, the full range defined
354 by the argument's type is accepted.  Any argument defined as a set of
355 alternatives can generate this error.
356 .TP 1i
357 .ZN BadWindow
358 A value for a Window argument does not name a defined Window.
359 .SH "SEE ALSO"
360 XAllowEvents(__libmansuffix__),
361 XGrabButton(__libmansuffix__),
362 XGrabKey(__libmansuffix__),
363 XGrabKeyboard(__libmansuffix__)
364 .br
365 \fI\*(xL\fP