pub struct ZwpPointerConstraintsV1 { /* private fields */ }
Expand description
constrain the movement of a pointer
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.
This interface has no events.
Implementations§
source§impl ZwpPointerConstraintsV1
impl ZwpPointerConstraintsV1
sourcepub fn destroy(&self)
pub fn destroy(&self)
destroy the pointer constraints manager object
Used by the client to notify the server that it will no longer use this pointer constraints object.
sourcepub fn lock_pointer<U: Send + Sync + 'static, D: Dispatch<ZwpLockedPointerV1, U> + 'static>(
&self,
surface: &WlSurface,
pointer: &WlPointer,
region: Option<&WlRegion>,
lifetime: Lifetime,
qh: &QueueHandle<D>,
udata: U,
) -> ZwpLockedPointerV1
pub fn lock_pointer<U: Send + Sync + 'static, D: Dispatch<ZwpLockedPointerV1, U> + 'static>( &self, surface: &WlSurface, pointer: &WlPointer, region: Option<&WlRegion>, lifetime: Lifetime, qh: &QueueHandle<D>, udata: U, ) -> ZwpLockedPointerV1
lock pointer to a position
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.
sourcepub fn confine_pointer<U: Send + Sync + 'static, D: Dispatch<ZwpConfinedPointerV1, U> + 'static>(
&self,
surface: &WlSurface,
pointer: &WlPointer,
region: Option<&WlRegion>,
lifetime: Lifetime,
qh: &QueueHandle<D>,
udata: U,
) -> ZwpConfinedPointerV1
pub fn confine_pointer<U: Send + Sync + 'static, D: Dispatch<ZwpConfinedPointerV1, U> + 'static>( &self, surface: &WlSurface, pointer: &WlPointer, region: Option<&WlRegion>, lifetime: Lifetime, qh: &QueueHandle<D>, udata: U, ) -> ZwpConfinedPointerV1
confine pointer to a region
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.
Trait Implementations§
source§impl Borrow<ObjectId> for ZwpPointerConstraintsV1
impl Borrow<ObjectId> for ZwpPointerConstraintsV1
source§impl Clone for ZwpPointerConstraintsV1
impl Clone for ZwpPointerConstraintsV1
source§fn clone(&self) -> ZwpPointerConstraintsV1
fn clone(&self) -> ZwpPointerConstraintsV1
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ZwpPointerConstraintsV1
impl Debug for ZwpPointerConstraintsV1
source§impl Hash for ZwpPointerConstraintsV1
impl Hash for ZwpPointerConstraintsV1
source§impl PartialEq<Weak<ZwpPointerConstraintsV1>> for ZwpPointerConstraintsV1
impl PartialEq<Weak<ZwpPointerConstraintsV1>> for ZwpPointerConstraintsV1
source§impl PartialEq for ZwpPointerConstraintsV1
impl PartialEq for ZwpPointerConstraintsV1
source§impl Proxy for ZwpPointerConstraintsV1
impl Proxy for ZwpPointerConstraintsV1
source§fn data<U: Send + Sync + 'static>(&self) -> Option<&U>
fn data<U: Send + Sync + 'static>(&self) -> Option<&U>
source§fn object_data(&self) -> Option<&Arc<dyn ObjectData>>
fn object_data(&self) -> Option<&Arc<dyn ObjectData>>
source§fn backend(&self) -> &WeakBackend
fn backend(&self) -> &WeakBackend
source§fn send_request(&self, req: Self::Request<'_>) -> Result<(), InvalidId>
fn send_request(&self, req: Self::Request<'_>) -> Result<(), InvalidId>
source§fn send_constructor<I: Proxy>(
&self,
req: Self::Request<'_>,
data: Arc<dyn ObjectData>,
) -> Result<I, InvalidId>
fn send_constructor<I: Proxy>( &self, req: Self::Request<'_>, data: Arc<dyn ObjectData>, ) -> Result<I, InvalidId>
source§fn from_id(conn: &Connection, id: ObjectId) -> Result<Self, InvalidId>
fn from_id(conn: &Connection, id: ObjectId) -> Result<Self, InvalidId>
source§fn inert(backend: WeakBackend) -> Self
fn inert(backend: WeakBackend) -> Self
source§fn parse_event(
conn: &Connection,
msg: Message<ObjectId, OwnedFd>,
) -> Result<(Self, Self::Event), DispatchError>
fn parse_event( conn: &Connection, msg: Message<ObjectId, OwnedFd>, ) -> Result<(Self, Self::Event), DispatchError>
source§fn write_request<'a>(
&self,
conn: &Connection,
msg: Self::Request<'a>,
) -> Result<(Message<ObjectId, BorrowedFd<'a>>, Option<(&'static Interface, u32)>), InvalidId>
fn write_request<'a>( &self, conn: &Connection, msg: Self::Request<'a>, ) -> Result<(Message<ObjectId, BorrowedFd<'a>>, Option<(&'static Interface, u32)>), InvalidId>
impl Eq for ZwpPointerConstraintsV1
Auto Trait Implementations§
impl Freeze for ZwpPointerConstraintsV1
impl !RefUnwindSafe for ZwpPointerConstraintsV1
impl Send for ZwpPointerConstraintsV1
impl Sync for ZwpPointerConstraintsV1
impl Unpin for ZwpPointerConstraintsV1
impl !UnwindSafe for ZwpPointerConstraintsV1
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.