The zwp_pointer_constraints_v1 interface

## Macros

#define | ZWP_POINTER_CONSTRAINTS_V1_DESTROY_SINCE_VERSION 1
#define | ZWP_POINTER_CONSTRAINTS_V1_LOCK_POINTER_SINCE_VERSION 1
#define | ZWP_POINTER_CONSTRAINTS_V1_CONFINE_POINTER_SINCE_VERSION 1

## Enumerations

enum | zwp_pointer_constraints_v1_error { ZWP_POINTER_CONSTRAINTS_V1_ERROR_ALREADY_CONSTRAINED = 1 }
enum | zwp_pointer_constraints_v1_lifetime { ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ONESHOT = 1, ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_PERSISTENT = 2 }

## Functions

static void | zwp_pointer_constraints_v1_set_user_data (struct zwp_pointer_constraints_v1 *zwp_pointer_constraints_v1, void *user_data)
static void * | zwp_pointer_constraints_v1_get_user_data (struct zwp_pointer_constraints_v1 *zwp_pointer_constraints_v1)
static void | zwp_pointer_constraints_v1_destroy (struct zwp_pointer_constraints_v1 *zwp_pointer_constraints_v1)
static struct zwp_locked_pointer_v1 * | zwp_pointer_constraints_v1_lock_pointer (struct zwp_pointer_constraints_v1 *zwp_pointer_constraints_v1, struct wl_surface *surface, struct wl_pointer *pointer, struct wl_region *region, uint32_t lifetime)
static struct zwp_confined_pointer_v1 * | zwp_pointer_constraints_v1_confine_pointer (struct zwp_pointer_constraints_v1 *zwp_pointer_constraints_v1, struct wl_surface *surface, struct wl_pointer *pointer, struct wl_region *region, uint32_t lifetime)

## Detailed Description

The global interface exposing pointer constraining functionality. It exposes two requests: lock_pointer for locking the pointer to its position, and confine_pointer for locking the pointer to a region.

The lock_pointer and confine_pointer requests create the objects wp_locked_pointer and wp_confined_pointer respectively, and the client can use these objects to interact with the lock.

For any surface, only one lock or confinement may be active across all wl_pointer objects of the same seat. If a lock or confinement is requested when another lock or confinement is active or requested on the same surface and with any of the wl_pointer objects of the same seat, an 'already_constrained' error will be raised.

## Macro Definition Documentation

## ZWP_POINTER_CONSTRAINTS_V1_CONFINE_POINTER_SINCE_VERSION

#define ZWP_POINTER_CONSTRAINTS_V1_CONFINE_POINTER_SINCE_VERSION 1

Definition at line 267 of file pointer-constraints-unstable-v1-client-protocol.h.

## ZWP_POINTER_CONSTRAINTS_V1_DESTROY_SINCE_VERSION

#define ZWP_POINTER_CONSTRAINTS_V1_DESTROY_SINCE_VERSION 1

Definition at line 259 of file pointer-constraints-unstable-v1-client-protocol.h.

## ZWP_POINTER_CONSTRAINTS_V1_LOCK_POINTER_SINCE_VERSION

#define ZWP_POINTER_CONSTRAINTS_V1_LOCK_POINTER_SINCE_VERSION 1

Definition at line 263 of file pointer-constraints-unstable-v1-client-protocol.h.

## Enumeration Type Documentation

## zwp_pointer_constraints_v1_error

enum zwp_pointer_constraints_v1_error

wp_pointer_constraints error values

These errors can be emitted in response to wp_pointer_constraints requests.

Enumerator
ZWP_POINTER_CONSTRAINTS_V1_ERROR_ALREADY_CONSTRAINED | pointer constraint already requested on that surface

Definition at line 226 of file pointer-constraints-unstable-v1-client-protocol.h.

{
/**
* pointer constraint already requested on that surface
*/
ZWP_POINTER_CONSTRAINTS_V1_ERROR_ALREADY_CONSTRAINED = 1,
};
ZWP_POINTER_CONSTRAINTS_V1_ERROR_ALREADY_CONSTRAINED
Definition: pointer-constraints-unstable-v1-client-protocol.h:230

## zwp_pointer_constraints_v1_lifetime

enum zwp_pointer_constraints_v1_lifetime

the pointer constraint may reactivate

A persistent pointer constraint may again reactivate once it has been deactivated. See the corresponding deactivation event (wp_locked_pointer.unlocked and wp_confined_pointer.unconfined) for details.

Enumerator
ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ONESHOT |
ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_PERSISTENT |

Definition at line 245 of file pointer-constraints-unstable-v1-client-protocol.h.

{
ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ONESHOT = 1,
ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_PERSISTENT = 2,
};
ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ONESHOT
Definition: pointer-constraints-unstable-v1-client-protocol.h:246
ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_PERSISTENT
Definition: pointer-constraints-unstable-v1-client-protocol.h:247

## Function Documentation

## zwp_pointer_constraints_v1_confine_pointer()

static struct zwp_confined_pointer_v1* zwp_pointer_constraints_v1_confine_pointer | ( | struct zwp_pointer_constraints_v1 * | zwp_pointer_constraints_v1,
|  | struct wl_surface * | surface,
|  | struct wl_pointer * | pointer,
|  | struct wl_region * | region,
|  | uint32_t | lifetime
| ) |  |

static

The confine_pointer request lets the client request to confine the pointer cursor to a given region. This request may not take effect immediately; in the future, when the compositor deems implementation- specific constraints are satisfied, the pointer confinement will be activated and the compositor sends a confined event.

The intersection of the region passed with this request and the input region of the surface is used to determine where the pointer must be in order for the confinement to activate. It is up to the compositor whether to warp the pointer or require some kind of user interaction for the confinement to activate. If the region is null the surface input region is used.

The request will create a new object wp_confined_pointer which is used to interact with the confinement as well as receive updates about its state. See the the description of wp_confined_pointer for further information.

Definition at line 375 of file pointer-constraints-unstable-v1-client-protocol.h.

References NULL, zwp_confined_pointer_v1_interface, and ZWP_POINTER_CONSTRAINTS_V1_CONFINE_POINTER.

{
struct wl_proxy *id;
id = wl_proxy_marshal_constructor((struct wl_proxy *) zwp_pointer_constraints_v1,
ZWP_POINTER_CONSTRAINTS_V1_CONFINE_POINTER, &zwp_confined_pointer_v1_interface, NULL, surface, pointer, region, lifetime);
return (struct zwp_confined_pointer_v1 *) id;
}
id
GLuint id
Definition: SDL_opengl_glext.h:528
ZWP_POINTER_CONSTRAINTS_V1_CONFINE_POINTER
#define ZWP_POINTER_CONSTRAINTS_V1_CONFINE_POINTER
Definition: pointer-constraints-unstable-v1-client-protocol.h:253
zwp_confined_pointer_v1_interface
const struct wl_interface zwp_confined_pointer_v1_interface
Definition: pointer-constraints-unstable-v1-protocol.c:93
surface
EGLSurface surface
Definition: eglext.h:248
pointer
GLsizei const void * pointer
Definition: SDL_opengl_glext.h:378
NULL
#define NULL
Definition: begin_code.h:164

## zwp_pointer_constraints_v1_destroy()

static void zwp_pointer_constraints_v1_destroy | ( | struct zwp_pointer_constraints_v1 * | zwp_pointer_constraints_v1 | ) |

inline static

Used by the client to notify the server that it will no longer use this pointer constraints object.

Definition at line 296 of file pointer-constraints-unstable-v1-client-protocol.h.

References ZWP_POINTER_CONSTRAINTS_V1_DESTROY.

{
wl_proxy_marshal((struct wl_proxy *) zwp_pointer_constraints_v1,
ZWP_POINTER_CONSTRAINTS_V1_DESTROY);
wl_proxy_destroy((struct wl_proxy *) zwp_pointer_constraints_v1);
}
ZWP_POINTER_CONSTRAINTS_V1_DESTROY
#define ZWP_POINTER_CONSTRAINTS_V1_DESTROY
Definition: pointer-constraints-unstable-v1-client-protocol.h:251

## zwp_pointer_constraints_v1_get_user_data()

static void* zwp_pointer_constraints_v1_get_user_data | ( | struct zwp_pointer_constraints_v1 * | zwp_pointer_constraints_v1 | ) |

inline static

Definition at line 278 of file pointer-constraints-unstable-v1-client-protocol.h.

{
return wl_proxy_get_user_data((struct wl_proxy *) zwp_pointer_constraints_v1);
}

## zwp_pointer_constraints_v1_lock_pointer()

static struct zwp_locked_pointer_v1* zwp_pointer_constraints_v1_lock_pointer | ( | struct zwp_pointer_constraints_v1 * | zwp_pointer_constraints_v1,
|  | struct wl_surface * | surface,
|  | struct wl_pointer * | pointer,
|  | struct wl_region * | region,
|  | uint32_t | lifetime
| ) |  |

static

The lock_pointer request lets the client request to disable movements of the virtual pointer (i.e. the cursor), effectively locking the pointer to a position. This request may not take effect immediately; in the future, when the compositor deems implementation-specific constraints are satisfied, the pointer lock will be activated and the compositor sends a locked event.

The protocol provides no guarantee that the constraints are ever satisfied, and does not require the compositor to send an error if the constraints cannot ever be satisfied. It is thus possible to request a lock that will never activate.

There may not be another pointer constraint of any kind requested or active on the surface for any of the wl_pointer objects of the seat of the passed pointer when requesting a lock. If there is, an error will be raised. See general pointer lock documentation for more details.

The intersection of the region passed with this request and the input region of the surface is used to determine where the pointer must be in order for the lock to activate. It is up to the compositor whether to warp the pointer or require some kind of user interaction for the lock to activate. If the region is null the surface input region is used.

A surface may receive pointer focus without the lock being activated.

The request creates a new object wp_locked_pointer which is used to interact with the lock as well as receive updates about its state. See the the description of wp_locked_pointer for further information.

Note that while a pointer is locked, the wl_pointer objects of the corresponding seat will not emit any wl_pointer.motion events, but relative motion events will still be emitted via wp_relative_pointer objects of the same seat. wl_pointer.axis and wl_pointer.button events are unaffected.

Definition at line 343 of file pointer-constraints-unstable-v1-client-protocol.h.

References NULL, zwp_locked_pointer_v1_interface, and ZWP_POINTER_CONSTRAINTS_V1_LOCK_POINTER.

{
struct wl_proxy *id;
id = wl_proxy_marshal_constructor((struct wl_proxy *) zwp_pointer_constraints_v1,
ZWP_POINTER_CONSTRAINTS_V1_LOCK_POINTER, &zwp_locked_pointer_v1_interface, NULL, surface, pointer, region, lifetime);
return (struct zwp_locked_pointer_v1 *) id;
}
id
GLuint id
Definition: SDL_opengl_glext.h:528
ZWP_POINTER_CONSTRAINTS_V1_LOCK_POINTER
#define ZWP_POINTER_CONSTRAINTS_V1_LOCK_POINTER
Definition: pointer-constraints-unstable-v1-client-protocol.h:252
surface
EGLSurface surface
Definition: eglext.h:248
zwp_locked_pointer_v1_interface
const struct wl_interface zwp_locked_pointer_v1_interface
Definition: pointer-constraints-unstable-v1-protocol.c:77
pointer
GLsizei const void * pointer
Definition: SDL_opengl_glext.h:378
NULL
#define NULL
Definition: begin_code.h:164

## zwp_pointer_constraints_v1_set_user_data()

static void zwp_pointer_constraints_v1_set_user_data | ( | struct zwp_pointer_constraints_v1 * | zwp_pointer_constraints_v1,
|  | void * | user_data
| ) |  |

inline static

Definition at line 271 of file pointer-constraints-unstable-v1-client-protocol.h.

{
wl_proxy_set_user_data((struct wl_proxy *) zwp_pointer_constraints_v1, user_data);
}