pointer_grab
Description:
[ Version ( deprecated = true , deprecated_since = "3.0" ) ]
public GrabStatus pointer_grab (Window window, bool owner_events, EventMask event_mask, Window? confine_to, Cursor? cursor, uint32 time_)
Warning: pointer_grab is deprecated since 3.0.
Grabs the pointer (usually a mouse) so that all events are passed to this application until the pointer is ungrabbed with pointer_ungrab, or the grab window becomes unviewable.
Use grab instead.
This overrides any previous pointer grab by this client.
Pointer grabs are used for operations which need complete control over mouse events, even if the mouse leaves the application. For example in
GTK+ it is used for Drag and Drop, for dragging the handle in the GtkHPaned
and GtkVPaned
widgets.
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.
Parameters:
window |
the Window which will own the grab (the grab window). |
owner_events |
if false then all pointer events are reported with respect to |
event_mask |
specifies the event mask, which is used in accordance with |
confine_to |
If non-null, the pointer will be confined to this window during the grab. If the pointer is outside
|
cursor |
the cursor to display while the grab is active. 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 a EventButton struct, though gdk_current_time can be used if the time isn’t known. |
Returns:
gdk_grab_success if the grab was successful. |