Warning: grab is deprecated since 3.20..
Grabs the device so that all events coming from this device are passed to this application until the device is ungrabbed with ungrab, or the window becomes unviewable.
Use grab instead.
This overrides any previous grab on the device by this client.
Note that this and window
need to be on the same display.
Device grabs are used for operations which need complete control over the given device events (either pointer or keyboard). For example in GTK+ this is used for Drag and Drop operations, popup menus and such.
Note that if the event mask of an X window has selected both button press and button release events, then a button press event will cause
an automatic pointer grab until the button is released. X does this automatically since most applications expect to receive button press
and release events in pairs. It is equivalent to a pointer grab on the window with owner_events
set to
true.
If you set up anything at the time you take the grab that needs to be cleaned up when the grab ends, you should handle the EventGrabBroken events that are emitted when the grab ends unvoluntarily.
this |
a Device. To get the device you can use |
window |
the Window which will own the grab (the grab window) |
grab_ownership |
specifies the grab ownership. |
owner_events |
if false then all device events are reported with respect to |
event_mask |
specifies the event mask, which is used in accordance with |
cursor |
the cursor to display while the grab is active if the device is a pointer. If this is null then
the normal cursors are used for |
time_ |
the timestamp of the event which led to this pointer grab. This usually comes from the Event struct, though gdk_current_time can be used if the time isn’t known. |
gdk_grab_success if the grab was successful. |