1XIGRABDEVICE(libmansuffix)
2==========================
3
4NAME
5----
6
7   XIGrabDevice, XIUngrabDevice - grab or ungrab the device.
8
9SYNOPSIS
10--------
11
12   #include <X11/extensions/XInput2.h>
13
14   Status XIGrabDevice( Display *display,
15                        int deviceid,
16                        Window grab_window,
17                        Time time,
18                        Cursor cursor,
19                        int grab_mode,
20                        int paired_device_mode,
21                        Bool owner_events,
22                        XIEventMask *mask);
23   
24   Status XIUngrabDevice( Display *display,
25                          int deviceid,
26                          Time time);
27
28   cursor
29          Specifies the cursor image to display for the duration
30          of the grab.
31
32   display
33          Specifies the connection to the X server.
34
35   deviceid
36          Specifies the device that should be grabbed or
37          ungrabbed.
38
39   grab_mode, paired_device_mode
40          The grab mode for this device and (if applicable) the
41          paired device.
42
43   grab_window
44          The grab window.
45
46   mask
47          Event mask.
48
49   owner_events
50          True if events are to be reported normally.
51
52   time
53          A valid timestamp or CurrentTime.
54
55DESCRIPTION
56-----------
57
58   XIGrabDevice actively grabs control of the device. Further
59   device events are reported only to the grabbing client.
60   XIGrabDevice overrides any active device grab by this client.
61
62   If the device is an attached slave device, the device is
63   automatically detached from the master device and reattached to
64   the same master device when client ungrabs the device. If the
65   master device is removed while the device is floating as a
66   result of a grab, the device remains floating once the grab
67   deactivates.
68
69   If owner_events is False, all generated device events are
70   reported with respect to grab_window if selected. If
71   owner_events is True and if a generated device event would
72   normally be reported to this client, it is reported normally;
73   otherwise, the event is reported with respect to the
74   grab_window, and is only reported if specified in the event
75   mask.
76
77   If the grab_mode argument is XIGrabModeAsync, device event
78   processing continues as usual. If the device is currently
79   frozen by this client, then processing of device events is
80   resumed. If the grab_mode argument is XIGrabModeSync, the state
81   of the device (as seen by client applications) appears to
82   freeze, and the X server generates no further device events
83   until the grabbing client issues a releasing XIAllowEvents call
84   or until the device grab is released. Actual device changes are
85   not lost while the device is frozen; they are simply queued in
86   the server for later processing.
87
88   If paired_device_mode is XIGrabModeAsync, processing of events
89   from the paired master device is unaffected by activation of
90   the grab. If paired_device_mode is XIGrabModeSync, the state of
91   the paired master device (as seen by client applications)
92   appears to freeze, and the X server generates no further events
93   from this device until the grabbing client issues a releasing
94   XIAllowEvents call or until the device grab is released. Actual
95   events are not lost while the devices are frozen; they are
96   simply queued in the server for later processing. If the device
97   is a slave device paired_device_mode is ignored.
98
99   If the device is actively grabbed by some other client,
100   XIGrabDevice fails and returns AlreadyGrabbed. If grab_window
101   is not viewable, it fails and returns GrabNotViewable. If the
102   device is frozen by an active grab of another client, it fails
103   and returns GrabFrozen. If the specified time is earlier than
104   the last-device-grab time or later than the current X server
105   time, it fails and returns GrabInvalidTime. Otherwise, the
106   last-device-grab time is set to the specified time. CurrentTime
107   is replaced by the current X server time.
108
109   If cursor is not None this cursor is displayed until the client
110   calls XIUngrabDevice.
111
112   XIGrabDevice can generate BadDevice, BadValue, and BadWindow
113   errors.
114
115   The XIUngrabDevice request releases the device and any queued
116   events if this client has it actively grabbed from either
117   XIGrabDevice or XIGrabKey or XIGrabButton. If other devices are
118   frozen by the grab, XUngrabDevice thaws them. XUngrabDevice
119   does not release the device and any queued events if the
120   specified time is earlier than the last-device-grab time or is
121   later than the current X server time. The X server
122   automatically performs an XIUngrabDevice request if the event
123   window for an active device grab becomes not viewable.
124
125   XIUngrabDevice can generate a BadDevice error.
126
127DIAGNOSTICS
128-----------
129
130   BadValue
131          A value is outside of the permitted range.
132
133   BadDevice
134          An invalid device was specified. The device does not
135          exist or is not a appropriate for the type of change.
136
137   BadMatch
138          The window is not viewable.
139
140   BadWindow
141          A value for a Window argument does not name a defined
142          Window.
143
144BUGS
145----
146
147   The protocol headers for XI 2.0 did not provide
148   XIGrabModeAsync or XIGrabModeSync. Use GrabModeSync and
149   GrabModeAsync instead, respectively.
150
151SEE ALSO
152--------
153   XIAllowEvents(libmansuffix)
154
155